/* ============ 管理后台样式 ============ */
body.admin { background: var(--bg); }

/* 登录页 */
.admin-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(800px 400px at 90% -10%, rgba(167, 139, 250, .35), transparent 60%),
    radial-gradient(600px 300px at 0% 110%, rgba(34, 211, 238, .25), transparent 55%),
    linear-gradient(135deg, #312e81, #4f46e5 60%, #6d28d9);
}
.login-card {
  background: #fff; border-radius: 22px; padding: 40px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 30px 70px -20px rgba(2, 6, 23, .5); text-align: center;
}
.login-logo { font-size: 3rem; }
.login-card h2 { margin: 6px 0 4px; }
.login-card .sub { color: var(--ink-2); margin: 0 0 18px; font-size: .92rem; }
.login-card input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px;
  font-size: 1rem; outline: none; margin-bottom: 4px;
}
.login-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 1rem; margin-top: 10px; }
.go-front { margin-top: 16px; font-size: .88rem; }
.go-front a { color: var(--ink-3); }
.go-front a:hover { color: var(--brand); }

/* 主体布局 */
.admin-body { display: flex; align-items: stretch; max-width: 1280px; margin: 0 auto; min-height: calc(100vh - 64px); }
.sidebar {
  width: 260px; flex: 0 0 260px; border-right: 1px solid var(--line); padding: 18px 14px; background: #fff;
  overflow-y: auto; max-height: calc(100vh - 64px); position: sticky; top: 64px;
}
.side-label { font-size: .78rem; color: var(--ink-3); margin: 16px 6px 8px; font-weight: 700; letter-spacing: 1px; }
.side-list { display: flex; flex-direction: column; gap: 4px; }
.side-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
  cursor: pointer; color: var(--ink-2); font-size: .93rem; border: 1px solid transparent;
}
.side-item:hover { background: #f1f5f9; }
.side-item.active { background: #eef2ff; color: #4338ca; font-weight: 600; border-color: #e0e7ff; }
.side-item .cnt { margin-left: auto; font-size: .76rem; background: #e2e8f0; border-radius: 999px; padding: 0 8px; color: var(--ink-3); }
.side-item.active .cnt { background: #c7d2fe; color: #3730a3; }
.side-item .del { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: .8rem; padding: 2px 5px; border-radius: 6px; display: none; }
.side-item:hover .del { display: block; }
.side-item .del:hover { background: #fee2e2; color: var(--red); }
.side-all { padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-size: .93rem; border: 1px dashed var(--line); }
.side-all.active { background: #eef2ff; border-style: solid; color: #4338ca; }
.side-all:hover { background: #f1f5f9; }

/* 主内容区 */
.a-main { flex: 1; padding: 22px 26px 60px; min-width: 0; }
.a-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.a-toolbar h2 { margin: 0; font-size: 1.35rem; }
.a-toolbar .sub { color: var(--ink-3); font-size: .88rem; }
.a-toolbar-spacer { flex: 1; }

.a-content .empty { color: var(--ink-3); text-align: center; padding: 60px 0; }
.a-content .empty .big { font-size: 2.6rem; margin-bottom: 10px; }

/* 管理端内容卡片 */
.a-entry {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 12px;
}
.a-entry-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.a-entry-head h3 { margin: 0; font-size: 1.02rem; flex: 1; min-width: 180px; }
.a-entry-head h3 small { color: var(--ink-3); font-weight: 500; font-size: .8rem; margin-left: 6px; }
.a-entry-foot { display: flex; align-items: center; gap: 14px; margin-top: 8px; color: var(--ink-3); font-size: .82rem; flex-wrap: wrap; }
.a-entry-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* 弹窗通用 */
.modal-wide { max-width: 560px; }
.modal-big { max-width: 760px; max-height: 92vh; overflow-y: auto; }
.f-label { display: block; font-size: .88rem; font-weight: 700; color: var(--ink-2); margin: 16px 0 6px; }
.f-input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: .94rem; outline: none; background: #fff; color: var(--ink); font-family: inherit;
}
.f-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.f-ta2 { min-height: 74px; resize: vertical; }
.f-ta6 { min-height: 220px; resize: vertical; line-height: 1.7; font-family: "Microsoft YaHei", inherit; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type=color] { width: 52px; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; cursor: pointer; background: #fff; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets .dot { width: 26px; height: 26px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.presets .dot.on { border-color: var(--ink); }
.tooltip { font-size: .8rem; color: var(--ink-3); margin: 4px 0 6px; }

/* 拖拽上传 */
.dropzone {
  border: 2px dashed #c7d2fe; border-radius: 14px; padding: 26px; text-align: center;
  color: var(--ink-2); cursor: pointer; background: #f8faff; transition: .15s;
}
.dropzone.drag { border-color: var(--brand); background: #eef2ff; }
.dropzone .dz-icon { font-size: 2rem; }
.dropzone b { font-size: .98rem; }
.dropzone .dz-sub { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }

.a-file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.a-file-row {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; background: #fbfcfe;
}
.a-file-row .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.a-file-row .fsize { color: var(--ink-3); font-size: .8rem; }
.a-file-row .fsize.up { color: var(--green); font-weight: 700; }
.uploading-tip { text-align: center; color: var(--ink-3); font-size: .86rem; padding: 6px 0; }

/* 分类标签按钮 */
.filter-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: .85rem; color: var(--ink-2); cursor: pointer;
}
.filter-btn.active { background: var(--brand-grad); border-color: transparent; color: #fff; }

@media (max-width: 860px) {
  .admin-body { flex-direction: column; }
  .sidebar { width: 100%; flex: none; border-right: 0; border-bottom: 1px solid var(--line); position: static; max-height: 260px; }
  .a-main { padding: 16px 14px 50px; }
}

/* ============ 子栏目（二级栏目） ============ */
/* 侧栏两级树 */
.side-cat { margin-bottom: 1px; }
.side-item.cat .arrow { transition: transform .15s; font-size: .7rem; color: var(--ink-3); width: 14px; flex: 0 0 14px; text-align: center; }
.side-item.cat .arrow.open { transform: rotate(90deg); }
.side-item.cat .ic { flex: 0 0 auto; }
.side-item.cat .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-subs { margin: 1px 0 4px 18px; border-left: 1px dashed #dbe3f0; padding-left: 6px; display: flex; flex-direction: column; gap: 2px; }
.side-sub {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 9px;
  cursor: pointer; color: var(--ink-2); font-size: .87rem;
}
.side-sub:hover { background: #f1f5f9; }
.side-sub.active { background: #eef2ff; color: #4338ca; font-weight: 600; }
.side-sub .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-sub .cnt { font-size: .74rem; background: #e2e8f0; border-radius: 999px; padding: 0 7px; color: var(--ink-3); }
.side-sub.active .cnt { background: #c7d2fe; color: #3730a3; }
.side-sub .del { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: .76rem; padding: 1px 4px; border-radius: 5px; display: none; }
.side-sub:hover .del { display: block; }
.side-sub .del:hover { background: #fee2e2; color: var(--red); }
.side-sub.empty { color: var(--ink-3); font-size: .8rem; font-style: italic; border: 1px dashed var(--line); }
.side-sub.empty:hover { background: #f8fafc; }

/* 工具栏面包屑 */
.a-toolbar h2.crumb { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: 700; }
.a-toolbar h2.crumb i { color: var(--ink-3); font-style: normal; }
.a-toolbar h2.crumb b { font-weight: 700; }

/* 区块与子栏目卡片 */
.a-block { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.a-block + .a-block { margin-top: 0; }
.a-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.a-block-head .t { font-size: 1rem; font-weight: 700; }
.a-block-head .s { color: var(--ink-3); font-size: .8rem; }
.a-block-head .sp { flex: 1; }
.a-sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.a-sub-card {
  position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  cursor: pointer; background: #fbfcfe; transition: border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.a-sub-card:hover { border-color: #a5b4fc; box-shadow: 0 6px 18px -10px rgba(79, 70, 229, .35); }
.a-sub-card .name { font-weight: 700; font-size: .96rem; color: var(--ink); }
.a-sub-card .desc { font-size: .8rem; color: var(--ink-3); min-height: 32px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.a-sub-card .meta { color: var(--ink-3); font-size: .8rem; }
.a-sub-card .acts { display: flex; gap: 6px; margin-top: 2px; }
.a-sub-card.add { border-style: dashed; align-items: center; justify-content: center; background: #f8faff; text-align: center; min-height: 96px; }
.a-sub-card.add:hover { border-color: var(--brand); }
.a-sub-card.add .plus { font-size: 1.6rem; color: var(--brand); line-height: 1; }
.a-sub-card.add .txt { font-size: .84rem; color: var(--ink-3); }

/* 按钮更小尺寸 */
.btn-xs { padding: 3px 9px; font-size: .78rem; border-radius: 8px; }

/* 表单两列布局（栏目 + 子栏目选择） */
.form-row { display: flex; gap: 14px; }
.form-row .col { flex: 1; min-width: 0; }

/* 内容行内子栏目标记 */
.a-sub-tag {
  display: inline-flex; align-items: center; gap: 3px; background: #f0f4ff; color: #4f46e5;
  border-radius: 999px; padding: 1px 9px; font-size: .76rem; font-weight: 600;
}
.a-sub-tag.muted { background: #f1f5f9; color: var(--ink-3); font-weight: 400; }

@media (max-width: 640px) {
  .form-row { flex-direction: column; gap: 0; }
  .a-sub-grid { grid-template-columns: 1fr 1fr; }
}

/* ============ 图标：Emoji / 图片 选择器 ============ */
.icon-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn {
  border: 0; background: transparent; padding: 6px 13px; border-radius: 8px;
  font-size: .86rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.seg-btn:hover { color: var(--brand); }
.seg-btn.on { background: #fff; color: #4f46e5; box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
img.icon-preview {
  width: 44px; height: 44px; object-fit: contain; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; padding: 3px;
}
.f-hint { font-size: .78rem; color: var(--ink-3); margin-top: 4px; }
.icon-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.icon-upload .hint { font-size: .78rem; color: var(--ink-3); max-width: 400px; line-height: 1.5; }
/* 栏目/子栏目 内嵌图片图标（列表 / 面包屑 / 徽章 / 卡片） */
img.ic-pic {
  width: 18px; height: 18px; object-fit: contain; vertical-align: -3px;
  border-radius: 3px; flex: 0 0 auto;
}
.side-item .ic img.ic-pic, .side-sub .ic img.ic-pic { width: 18px; height: 18px; }
.a-toolbar h2 img.ic-pic { width: 28px; height: 28px; vertical-align: -6px; }
.badge img.ic-pic { width: 15px; height: 15px; vertical-align: -2px; }
.a-sub-card .name img.ic-pic { width: 18px; height: 18px; vertical-align: -3px; }
