* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #FAF7F2; color: #2B2420; min-height: 100vh;
}
.hidden { display: none !important; }

/* 登录 */
.login-box {
  width: 320px; margin: 14vh auto; background: #fff; padding: 32px;
  border-radius: 20px; box-shadow: 0 8px 32px rgba(43,36,32,0.08);
  display: flex; flex-direction: column; gap: 14px;
}
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 8px; }
.login-box input {
  height: 44px; padding: 0 14px; border: 1px solid #F0EAE3;
  border-radius: 12px; font-size: 14px;
}
.login-box button {
  height: 44px; border: none; border-radius: 12px; background: #FF6B35;
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.err { color: #ef4444; font-size: 13px; text-align: center; min-height: 16px; }

/* 面板 */
.panel { max-width: 920px; margin: 0 auto; padding: 20px; }
.panel header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.panel header span { font-size: 20px; font-weight: 800; }
.ghost {
  background: #fff; border: 1px solid #F0EAE3; border-radius: 10px;
  padding: 8px 16px; cursor: pointer; font-size: 13px;
}

/* 卡片 */
.cards { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.card {
  flex: 1; min-width: 140px; background: #fff; border-radius: 16px;
  padding: 18px; box-shadow: 0 4px 16px rgba(43,36,32,0.05);
  display: flex; flex-direction: column; gap: 6px;
}
.card b { font-size: 28px; }
.card span { font-size: 13px; color: #9A8F86; }
.card.warn b { color: #f59e0b; }
.card.ok b { color: #10b981; }
.card.bad b { color: #ef4444; }

/* 过滤 */
.filter { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.fbtn {
  padding: 8px 18px; border-radius: 999px; border: none; background: #fff;
  font-size: 14px; color: #9A8F86; cursor: pointer;
}
.fbtn.active { background: #FF6B35; color: #fff; font-weight: 600; }

/* 列表 */
.list { display: flex; flex-direction: column; gap: 12px; }
.item {
  background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 4px 16px rgba(43,36,32,0.05);
  display: flex; gap: 14px; align-items: center;
}
.item .info { flex: 1; min-width: 0; }
.item .name { font-size: 16px; font-weight: 700; }
.item .meta { font-size: 13px; color: #9A8F86; margin-top: 4px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; margin-right: 6px; }
.tag.pending { background: #f59e0b; }
.tag.approved { background: #10b981; }
.tag.rejected { background: #ef4444; }
.actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.actions button {
  padding: 8px 14px; border-radius: 10px; border: none; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.b-ok { background: #10b981; color: #fff; }
.b-bad { background: #ef4444; color: #fff; }
.b-edit { background: #FF6B35; color: #fff; }
.b-del { background: #fff; border: 1px solid #F0EAE3; color: #ef4444; }
.empty { text-align: center; color: #9A8F86; padding: 60px 0; }

/* Tab 导航 */
.tabs-nav { display: flex; gap: 8px; margin-bottom: 18px; }
.tnav {
  padding: 8px 20px; border-radius: 999px; border: none; background: #fff;
  font-size: 14px; color: #9A8F86; cursor: pointer; font-weight: 600;
}
.tnav.active { background: #2B2420; color: #fff; }

/* 配置管理 */
#configSection h2 { font-size: 17px; margin: 22px 0 8px; }
#configSection .hint-line { font-size: 13px; color: #9A8F86; margin-bottom: 10px; }
.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-row {
  display: grid; grid-template-columns: 1.2fr 1.2fr 0.8fr 48px auto; gap: 8px;
  align-items: center; background: #fff; border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(43,36,32,0.04);
}
.cat-row input {
  height: 38px; padding: 0 10px; border: 1px solid #F0EAE3; border-radius: 10px; font-size: 14px;
}
.cat-row .c-color { padding: 2px; height: 38px; cursor: pointer; }
.cat-row .c-emoji { text-align: center; }
.b-edit { background: #FF6B35; color: #fff; }
.b-ok { background: #10b981; color: #fff; }
.wide { width: 100%; margin-top: 14px; height: 46px; font-size: 15px; font-weight: 700; border: none; border-radius: 12px; cursor: pointer; }

.cfg-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.cfg-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #6b625b; }
.cfg-form input {
  height: 42px; padding: 0 12px; border: 1px solid #F0EAE3; border-radius: 10px; font-size: 14px;
}

/* 功能图标编辑（图片上传 + 单图标保存） */
.icon-list { display: flex; flex-direction: column; gap: 8px; }
.icon-row {
  display: grid; grid-template-columns: 1.1fr 52px 0.7fr 1.1fr 92px; gap: 8px; align-items: center;
  background: #fff; border-radius: 12px; padding: 8px 12px; box-shadow: 0 2px 10px rgba(43,36,32,0.04);
}
.icon-row .i-label { font-size: 13px; color: #4b443e; }
.icon-row .i-preview {
  width: 48px; height: 48px; border-radius: 10px; background: #F5F1EC;
  display: flex; align-items: center; justify-content: center; font-size: 22px; overflow: hidden;
}
.icon-row .i-preview img { width: 100%; height: 100%; object-fit: contain; }
.icon-row .i-emoji { height: 38px; padding: 0 10px; border: 1px solid #F0EAE3; border-radius: 10px; font-size: 16px; text-align: center; }
.icon-row .i-file { font-size: 12px; max-width: 150px; }
.icon-row .i-ops { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.icon-row .i-save { padding: 6px 12px; font-size: 12px; border: none; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.icon-row .i-status { font-size: 11px; min-height: 14px; color: #9A8F86; }
.icon-row .i-status.ok { color: #10b981; }
.icon-row .i-status.err { color: #ef4444; }

/* 工具栏：搜索 + 过滤 */
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
#searchBox {
  flex: 1; min-width: 200px; height: 42px; padding: 0 16px;
  border: 1px solid #F0EAE3; border-radius: 999px; font-size: 14px;
}
.toolbar .filter { margin: 0; }

/* 群缩略图 + 分类色块 */
.item .thumb {
  width: 72px; height: 72px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: #F0EAE3;
}
.item .thumb.none {
  display: flex; align-items: center; justify-content: center; font-size: 30px; background: #F5F1EC;
}
.ctag {
  display: inline-block; padding: 2px 10px; border-radius: 999px; color: #fff;
  font-size: 12px; font-weight: 600; margin-right: 6px;
}
code { background: #F0EAE3; padding: 1px 6px; border-radius: 6px; font-size: 12px; word-break: break-all; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.pinfo { font-size: 13px; color: #9A8F86; }

/* 模态框 */
.modal {
  position: fixed; inset: 0; background: rgba(43,36,32,0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-box {
  background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 420px;
  max-height: 88vh; overflow: auto; box-shadow: 0 16px 48px rgba(43,36,32,0.2);
  display: flex; flex-direction: column; gap: 12px;
}
.modal-box h3 { font-size: 18px; }
.modal-box label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #6b625b; }
.modal-box input, .modal-box select {
  height: 40px; padding: 0 12px; border: 1px solid #F0EAE3; border-radius: 10px; font-size: 14px;
}
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions button { flex: 1; height: 42px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
#uBody h4 { margin: 12px 0 6px; font-size: 14px; }
.umin { font-size: 13px; color: #4b443e; padding: 6px 0; border-bottom: 1px solid #F5F1EC; }

/* 用户管理 */
#usersSection .hint-line { margin-bottom: 14px; }
