/* 山东内卷网 · 管理后台
   配色沿用小程序：主色 #1E6FFF，底色 #F5F6FA */
:root {
  --blue: #1E6FFF;
  --blue-d: #1554D8;
  --blue-l: #EBF2FF;
  --orange: #FF7A45;
  --green: #00B578;
  --red: #F53F3F;
  --amber: #F59E0B;
  --purple: #7C5CFF;
  --ink: #1F2329;
  --ink-2: #4E5969;
  --ink-3: #86909C;
  --ink-4: #A9AFBB;
  --line: #EDEFF3;
  --bg: #F5F6FA;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(31, 35, 41, .05);
}

* { box-sizing: border-box; }
/* hidden 属性要能压过组件里显式写的 display（否则空缩略图会露出破图标） */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { list-style: none; padding: 0; }

/* ---------- 提示条 ---------- */
.flash-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 10px 20px; border-radius: 8px; color: #fff; font-size: 13px;
  box-shadow: 0 6px 20px rgba(31, 35, 41, .18); transition: opacity .4s;
  animation: drop .25s ease;
}
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.flash-ok { background: var(--green); }
.flash-error { background: var(--red); }
.flash-warn { background: var(--amber); }

/* ---------- 框架 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: var(--white);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; }
.brand-badge {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, #1E6FFF, #63A8FF);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 15px; letter-spacing: .3px; }
.brand-text i { font-style: normal; font-size: 11px; color: var(--ink-4); }

.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-title { padding: 14px 10px 6px; font-size: 11px; color: var(--ink-4); letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px;
  color: var(--ink-2); font-size: 13.5px; position: relative; transition: .15s;
}
.nav-item .ico { font-size: 15px; width: 18px; text-align: center; }
.nav-item:hover { background: #F4F7FC; color: var(--ink); }
.nav-item.on { background: var(--blue-l); color: var(--blue-d); font-weight: 600; }
.nav-item.on::before { content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: 0 2px 2px 0; background: var(--blue); }
.nav-dot {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 600; font-style: normal;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-4); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: var(--white); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 17px; font-weight: 600; }
.page-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; color: var(--ink-2); }
.content { padding: 22px 26px 40px; flex: 1; }

/* ---------- 卡片 / 区块 ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 14.5px; font-weight: 600; }
.card-head .hint { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 8px; }
.card-body { padding: 18px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; cursor: pointer; transition: .15s; background: none; color: var(--ink-2);
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); }
.btn-ghost { border-color: var(--line); background: var(--white); }
.btn-ghost:hover { border-color: #CBD3E0; color: var(--ink); }
.btn-soft { background: var(--blue-l); color: var(--blue-d); }
.btn-soft:hover { background: #DCE8FF; }
.btn-danger { background: #FEF0F0; color: var(--red); }
.btn-danger:hover { background: #FDDCDC; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.field .tip { font-weight: 400; font-size: 12px; color: var(--ink-4); margin-left: 6px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid #DFE3EA; border-radius: 8px; padding: 9px 12px;
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--white); transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 111, 255, .1); }
.textarea { min-height: 92px; resize: vertical; line-height: 1.7; }

/* 密码框：右侧眼睛按钮切换显示 / 隐藏 */
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 44px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 8px; cursor: pointer;
  color: #98A1B0; transition: .15s;
}
.pwd-eye:hover { background: #F2F5FA; color: #55606F; }
.pwd-eye:focus-visible { outline: 2px solid rgba(30, 111, 255, .35); outline-offset: 1px; }
.pwd-eye svg { width: 18px; height: 18px; display: block; }
.pwd-eye .ico-off { display: none; }
.pwd-eye.is-on .ico-on { display: none; }
.pwd-eye.is-on .ico-off { display: block; }
.select { appearance: none; background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%2386909C' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 32px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }.color-row { display: flex; gap: 10px; align-items: center; }

/* 开关（用户管理 · 测试账号总开关） */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #CBD3E1; border-radius: 999px; transition: background .18s;
}
.switch .slider::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .18s;
}
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(30, 111, 255, .18); }
input[type=color] { width: 46px; height: 34px; border: 1px solid #DFE3EA; border-radius: 8px; background: none; padding: 2px; cursor: pointer; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
table.table th, table.table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.table th { background: #FAFBFC; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
table.table td { font-size: 13px; }
table.table tbody tr:hover { background: #FAFCFF; }
table.table tbody tr:last-child td { border-bottom: none; }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.logo-cell { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; background: #F2F4F8; }
.logo-ph { width: 42px; height: 42px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; font-weight: 600; }

/* ---------- 徽章 / 状态 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-pending { background: #FFF3E0; color: #D97706; }
.badge-approved { background: #E6F8F1; color: #059E79; }
.badge-rejected { background: #FEF0F0; color: var(--red); }
.badge-blue { background: var(--blue-l); color: var(--blue-d); }
.badge-gray { background: #F2F4F7; color: var(--ink-3); }
.tag { display: inline-block; padding: 1px 8px; margin: 0 4px 4px 0; border-radius: 5px; background: #F2F4F7; color: var(--ink-2); font-size: 11.5px; }

/* ---------- 筛选条 ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filter .input, .filter .select { height: 34px; padding: 0 12px; width: auto; min-width: 130px; }
.filter .grow { flex: 1; min-width: 180px; }
.filter .btn { height: 34px; }

/* 分类管理页：可折叠面板（<details>） */
.acc {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 8px; overflow: hidden; transition: box-shadow .15s, border-color .15s;
  scroll-margin-top: 14px;
}
.acc[open] { box-shadow: var(--shadow); border-color: #DDE6F5; margin-bottom: 12px; }
.acc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; cursor: pointer; user-select: none; list-style: none;
}
.acc-head::-webkit-details-marker { display: none; }
.acc-head:hover { background: #FAFBFF; }
.acc-caret {
  width: 7px; height: 7px; flex: none; margin-right: 2px;
  border-right: 1.7px solid var(--ink-3); border-bottom: 1.7px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform .18s;
}
.acc[open] .acc-caret { transform: rotate(45deg); border-color: var(--blue); }
.acc-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.acc-n {
  font-size: 11.5px; font-weight: 400; color: var(--ink-3);
  background: #F2F5FA; padding: 2px 8px; border-radius: 6px;
}
.acc[open] .acc-n { background: var(--blue-l); color: var(--blue); }
.acc-kw { font-size: 11.5px; color: var(--blue); }
.acc-hint { margin-left: auto; font-size: 12px; color: var(--ink-4); }
.acc[open] .acc-hint { display: none; }
.acc-body { border-top: 1px solid var(--line); }
.acc-body .filter:last-of-type { border-bottom: 1px solid var(--line); }

/* 说明卡里的二级折叠 */
.acc-tipcard { margin-bottom: 10px; }
.tip-details { margin-top: 4px; }
.tip-details summary {
  display: inline-block; cursor: pointer; color: var(--blue); font-size: 12.5px;
  list-style: none;
}
.tip-details summary::-webkit-details-marker { display: none; }
.tip-details summary::before { content: '▸ '; }
.tip-details[open] summary::before { content: '▾ '; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px; }
.pager a, .pager span {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 12.5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pager a:hover { border-color: var(--blue); color: var(--blue); }
.pager .on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.pager .gap { border: none; background: none; }
.pager-info { margin-left: 10px; font-size: 12px; color: var(--ink-3); }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.stat-ico { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 44px; }
.stat-num { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 12.5px; color: var(--ink-3); }
.stat-link { display: block; }
.stat:hover { border-color: #D6DEEB; }

/* ---------- 空态 ---------- */
.empty { padding: 54px 20px; text-align: center; color: var(--ink-3); }
.empty .ico { font-size: 40px; display: block; margin-bottom: 10px; opacity: .55; }
.empty p { font-size: 13px; }

/* ---------- 待审核列表 ---------- */
.pending-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.pending-row:last-child { border-bottom: none; }
.pending-row .kind { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--blue-l); color: var(--blue-d); font-weight: 600; flex: 0 0 auto; }
.pending-row .txt { flex: 1; min-width: 0; }
.pending-row .txt b { font-size: 13.5px; font-weight: 600; }
.pending-row .txt span { display: block; font-size: 12px; color: var(--ink-3); }

/* ---------- 图片上传预览 ---------- */
.imgs-edit { display: flex; flex-wrap: wrap; gap: 12px; }
.img-box { width: 104px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.img-box img { width: 100%; height: 104px; object-fit: cover; display: block; background: #F2F4F8; }
.img-box .bar { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 5px; font-size: 11.5px; color: var(--ink-3); border-top: 1px solid var(--line); }
.img-add {
  width: 104px; height: 104px; border: 1.5px dashed #C9D1DE; border-radius: 10px; background: #FAFBFC;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink-3); font-size: 12px; cursor: pointer; position: relative; text-align: center;
}
.img-add:hover { border-color: var(--blue); color: var(--blue); background: #F7FAFF; }
.img-add input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-add .plus { font-size: 22px; line-height: 1; }

/* ---------- 图片字段：本地上传 / 填写 URL 切换 ---------- */
.imgfield { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: #FBFCFE; }
.imgfield-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.seg { display: inline-flex; background: #EDF0F5; border-radius: 8px; padding: 3px; }
.seg-btn {
  border: 0; background: transparent; color: var(--ink-3); font: inherit; font-size: 12.5px;
  padding: 5px 16px; border-radius: 6px; cursor: pointer; transition: background .15s, color .15s;
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.on { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 1px 3px rgba(31, 35, 41, .1); }
.imgfield-clear {
  border: 0; background: transparent; color: var(--red); font: inherit; font-size: 12.5px;
  padding: 4px 6px; cursor: pointer;
}
.imgfield-clear:hover { text-decoration: underline; }
.imgfield-body { display: flex; gap: 14px; align-items: flex-start; }
.imgfield-thumb {
  width: 104px; height: 104px; flex: none; border: 1px solid var(--line); border-radius: 10px;
  background: #F2F4F8; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.imgfield-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgfield-empty { font-size: 12px; color: var(--ink-4); }
.imgfield-pane-wrap { flex: 1; min-width: 0; }
.imgfield-pick {
  position: relative; height: 46px; border: 1.5px dashed #C9D1DE; border-radius: 10px; background: #fff;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--ink-3); font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.imgfield-pick:hover { border-color: var(--blue); color: var(--blue); background: #F7FAFF; }
.imgfield-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.imgfield-pick .plus { font-size: 16px; line-height: 1; }
.imgfield-hint { margin-top: 6px; font-size: 12px; color: var(--ink-4); }

/* ---------- 登录页 ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #EAF1FF 0%, #F6F8FC 55%, #EEF5FF 100%); }
.login-card { width: 380px; background: #fff; border-radius: 16px; padding: 38px 34px 30px; box-shadow: 0 18px 50px rgba(24, 52, 105, .12); }
.login-head { text-align: center; margin-bottom: 26px; }
.login-head .badge-box { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #1E6FFF, #63A8FF); color: #fff; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.login-head h1 { font-size: 19px; font-weight: 600; }
.login-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.login-tip { margin-top: 16px; text-align: center; font-size: 12px; color: var(--ink-4); }
.login-tip code { background: #F2F4F7; padding: 1px 6px; border-radius: 4px; color: var(--ink-2); }

/* 登录页：记住账号 / 免登录 */
.login-opts { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.login-opts .checkline { font-size: 12.5px; }
.login-opts input[type=checkbox] { width: 14px; height: 14px; accent-color: #1E6FFF; }

/* ---------- 其他 ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.page-head .sub { font-size: 12.5px; color: var(--ink-3); }
.form-actions { display: flex; gap: 10px; padding-top: 4px; }
.back-link { color: var(--blue); font-size: 13px; }
.form-note { background: #F8FAFF; border: 1px solid #E3EDFF; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 16px; }

/* 首页分类：宫格图标预览 + 底色选择器 */
.quick-preview {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px; font-size: 20px; line-height: 1;
  vertical-align: middle; border: 1px solid rgba(0, 0, 0, 0.04);
}
.color-input {
  width: 56px; height: 34px; padding: 2px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 6px; }

@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 32px; }
  .topbar { padding: 0 16px; }
}
