/* ============================================
   长春市禁毒教育有奖问答 - 管理端样式
   ============================================ */
:root {
  --brand-1: #2b6ef3;
  --brand-2: #7b4dff;
  --brand-grad: linear-gradient(135deg, #2b6ef3 0%, #7b4dff 100%);
  --bg-1: #eaf2ff;
  --bg-2: #f4efff;
  --card: rgba(255, 255, 255, 0.86);
  --text: #1c2333;
  --text-sub: #6b7488;
  --border: rgba(43, 110, 243, 0.12);
  --danger: #e5484d;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 12px 40px rgba(43, 110, 243, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: linear-gradient(160deg, var(--bg-1) 0%, #eef7f5 40%, var(--bg-2) 100%);
  min-height: 100vh; color: var(--text);
}

.bg-orb { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .4; pointer-events: none; z-index: 0; }
.bg-orb-1 { width: 300px; height: 300px; background: #cfe0ff; top: -80px; right: -80px; }
.bg-orb-2 { width: 260px; height: 260px; background: #e3d4ff; bottom: -60px; left: -80px; }

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; z-index: 1;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--card); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 38px 32px;
  text-align: center;
}
.login-logo { font-size: 46px; margin-bottom: 10px; }
.login-title { font-size: 22px; font-weight: 800; }
.login-sub { font-size: 13px; color: var(--text-sub); margin: 8px 0 26px; }
.login-tip { margin-top: 18px; font-size: 12px; color: #98a1b6; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.form-group input, .form-group select {
  width: 100%; padding: 12px 14px; font-size: 14px; font-family: inherit;
  border: 1.5px solid var(--border); border-radius: 12px; outline: none; background: rgba(255,255,255,.92);
}
.form-group input:focus { border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(43,110,243,.12); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.switch-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.switch-label input { width: auto; }

/* ============ 按钮 ============ */
.btn {
  border: none; cursor: pointer; font-size: 14px; font-weight: 700; font-family: inherit;
  border-radius: 50px; padding: 11px 22px; transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px rgba(96,100,255,.30); }
.btn-ghost { background: rgba(43,110,243,.08); color: var(--brand-1); }
.btn-danger { background: rgba(229,72,77,.1); color: var(--danger); border: 1px solid rgba(229,72,77,.25); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; }

/* ============ 管理主界面 ============ */
.admin-wrap { position: relative; z-index: 1; }
.admin-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; background: rgba(255,255,255,.8);
  backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.7);
  position: sticky; top: 0; z-index: 10;
}
.admin-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 26px; }
.brand-text b { font-size: 15px; display: block; }
.brand-text small { font-size: 11px; color: var(--text-sub); }
.admin-user { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.user-badge { font-size: 18px; }

.admin-body { display: flex; max-width: 1200px; margin: 0 auto; padding: 20px 16px; gap: 18px; align-items: flex-start; }
.admin-nav {
  width: 190px; flex-shrink: 0; position: sticky; top: 80px;
  background: var(--card); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--text-sub);
  cursor: pointer; transition: all .18s; text-decoration: none;
}
.nav-item span { font-size: 16px; }
.nav-item:hover { background: rgba(43,110,243,.06); color: var(--text); }
.nav-item.active { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px rgba(96,100,255,.3); }

.admin-main { flex: 1; min-width: 0; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view-title { font-size: 19px; font-weight: 800; margin-bottom: 16px; }
.view-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.view-head .view-title { margin-bottom: 0; }

.card-box {
  background: var(--card); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
}
.card-box h3 { font-size: 15px; margin-bottom: 14px; }
.form-tip { font-size: 12px; color: var(--text-sub); margin-bottom: 14px; line-height: 1.7; }
.danger-box h3 { color: var(--danger); }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius-md);
  box-shadow: var(--shadow); padding: 18px 14px; text-align: center;
}
.stat-num { font-size: 28px; font-weight: 800; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { font-size: 12px; color: var(--text-sub); margin-top: 6px; }

/* 表格 */
.prize-table, .data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prize-table th, .prize-table td, .data-table th, .data-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid rgba(43,110,243,.08); }
.prize-table th, .data-table th { color: var(--text-sub); font-weight: 600; font-size: 12px; }
.prize-table tr:last-child td, .data-table tr:last-child td { border-bottom: none; }

.progress-bar { height: 8px; background: rgba(43,110,243,.10); border-radius: 8px; overflow: hidden; }
.progress-bar.big { height: 14px; }
.progress-fill { height: 100%; background: var(--brand-grad); border-radius: 8px; transition: width .4s; }
.cap-text { font-size: 13px; color: var(--text-sub); margin-top: 8px; }

/* 题目卡片 */
.q-card {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 12px; background: rgba(255,255,255,.7);
}
.q-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.q-question { font-size: 14px; font-weight: 700; line-height: 1.6; }
.q-opts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.q-opt {
  font-size: 12px; padding: 5px 12px; border-radius: 50px;
  background: rgba(43,110,243,.06); color: var(--text-sub);
}
.q-opt.correct { background: rgba(43,110,243,.14); color: var(--brand-1); font-weight: 700; }
.q-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 奖品卡片 */
.p-card { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 10px; background: rgba(255,255,255,.7); }
.p-icon { font-size: 34px; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; background: rgba(43,110,243,.08); border-radius: 14px; flex-shrink: 0; }
.p-info { flex: 1; min-width: 0; }
.p-name { font-size: 14px; font-weight: 700; }
.p-meta { font-size: 12px; color: var(--text-sub); margin-top: 4px; line-height: 1.7; }
.p-tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: rgba(43,110,243,.1); color: var(--brand-1); margin-left: 6px; }
.p-tag.thanks { background: rgba(107,116,136,.12); color: var(--text-sub); }

/* 记录列表 */
.search-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-bar input { flex: 1; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 12px; outline: none; font-size: 14px; }
.rec-row { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 4px; border-bottom: 1px dashed rgba(43,110,243,.12); font-size: 13px; }
.rec-row:last-child { border-bottom: none; }
.rec-row .rec-name { font-weight: 700; }
.rec-row .rec-prize.win { color: var(--brand-1); font-weight: 700; }
.rec-row .rec-prize.lose { color: var(--text-sub); }
.rec-time { color: #98a1b6; font-size: 12px; margin-left: auto; }
.empty { text-align: center; color: #98a1b6; padding: 30px 0; font-size: 13px; }

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.page-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 13px; color: var(--text); }
.page-btn.active { background: var(--brand-grad); color: #fff; border-color: transparent; }
.page-btn:disabled { opacity: .4; cursor: default; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 90; background: rgba(20,30,70,.5);
  backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: var(--radius-lg); padding: 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25); animation: fadeIn .25s ease;
}
.modal h3 { font-size: 17px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.opt-input-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.opt-input-row .opt-key { width: 26px; height: 26px; border-radius: 50%; background: rgba(43,110,243,.1); color: var(--brand-1); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.opt-input-row input { flex: 1; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 10px; outline: none; font-size: 14px; }
.opt-input-row input.correct-opt { border-color: var(--brand-1); background: rgba(43,110,243,.05); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(28,35,51,.92); color: #fff; font-size: 14px; padding: 12px 22px;
  border-radius: 50px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 100; max-width: 86%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 移动端适配 ============ */
@media (max-width: 767px) {
  .admin-body { flex-direction: column; padding: 14px 12px; }
  .admin-nav { width: 100%; position: static; flex-direction: row; overflow-x: auto; padding: 8px; gap: 6px; }
  .nav-item { flex-shrink: 0; padding: 10px 14px; font-size: 13px; }
  .nav-item span { font-size: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-top { padding: 12px 14px; }
  .brand-text small { display: none; }
  .q-head { flex-direction: column; }
  .p-card { flex-wrap: wrap; }
  .rec-time { width: 100%; margin-left: 0; }
}
