/* 数据管理后台样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #020617;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #020617; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.topbar h1 { font-size: 17px; font-weight: 700; color: #fff; white-space: nowrap; }
.sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.status {
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
}
.status-online { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(52,211,153,.3); }
.status-offline { background: rgba(244,63,94,.15); color: #fb7185; border: 1px solid rgba(244,63,94,.3); }
.status-loading { background: rgba(251,191,36,.12); color: #fcd34d; border: 1px solid rgba(251,191,36,.3); }

/* 按钮 */
.btn {
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 9px 16px;
  transition: all .15s ease;
}
.btn:active { transform: scale(.96); }
.btn-amber { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #020617; }
.btn-ghost { background: #1e293b; color: #cbd5e1; border: 1px solid #334155; }
.btn-ghost:hover { background: #273449; }
.btn-danger { background: rgba(244,63,94,.12); color: #fb7185; border: 1px solid rgba(244,63,94,.25); }
.btn-danger:hover { background: rgba(244,63,94,.2); }
.btn-save { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.btn-sync { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; }
.btn-sync:hover { filter: brightness(1.1); }

/* 工具栏 */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px; flex-wrap: wrap;
}
.search {
  flex: 1; min-width: 220px;
  background: #0f172a; border: 1px solid #1e293b; border-radius: 10px;
  color: #fff; font-size: 13px; padding: 10px 14px; outline: none;
}
.search:focus { border-color: #f59e0b; }
.count { font-size: 12px; color: #64748b; }

/* 明星卡片 */
.list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr));
  gap: 16px; padding: 8px 24px 48px;
}
.card {
  background: #0f172a; border: 1px solid #1e293b; border-radius: 16px;
  padding: 16px; transition: border-color .2s;
}
.card:hover { border-color: #334155; }
.card.new-card { border-color: #f59e0b; box-shadow: 0 0 0 1px rgba(245,158,11,.3); }

.card-head { display: flex; gap: 16px; align-items: flex-start; }

/* 头像区 */
.avatar-zone { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.avatar-box {
  width: 96px; height: 96px; border-radius: 14px; overflow: hidden;
  border: 2px dashed #334155; cursor: pointer; position: relative;
  background: #020617; display: flex; align-items: center; justify-content: center;
}
.avatar-box:hover { border-color: #f59e0b; }
.avatar-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-box .hint {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
  color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.avatar-box:hover .hint { opacity: 1; }
.avatar-cap { font-size: 10px; color: #64748b; text-align: center; }

/* 字段区 */
.fields { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 11px; color: #94a3b8; font-weight: 600; }
.field input, .field textarea, .field select {
  background: #020617; border: 1px solid #1e293b; border-radius: 8px;
  color: #fff; font-size: 13px; padding: 8px 10px; outline: none; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: #f59e0b; }
.field input.num { color: #fbbf24; font-family: ui-monospace, monospace; font-weight: 600; }
.field textarea { resize: vertical; min-height: 52px; }

/* 卡片操作 */
.card-actions {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #1e293b;
  display: flex; justify-content: flex-end; gap: 10px;
}
.save-state { font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 6px; margin-right: auto; }
.save-state.saving { color: #fcd34d; }
.save-state.saved { color: #34d399; }

/* 全部代言管理 */
.end-manage {
  margin-top: 12px;
  border: 1px solid #1e293b;
  border-radius: 12px;
  background: #020617;
  overflow: hidden;
}
.end-manage-head {
  padding: 10px 14px;
  font-size: 12px; font-weight: 600; color: #cbd5e1;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.end-manage-head:hover { background: #0f172a; }
.end-arrow { color: #64748b; transition: transform .15s; }
.end-list { padding: 4px 10px 10px; }
.end-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed #1e293b;
}
.end-row:last-of-type { border-bottom: none; }
.end-logo-box {
  width: 44px; height: 44px; border-radius: 10px; overflow: hidden;
  border: 1px dashed #334155; cursor: pointer; flex-shrink: 0;
  background: #0f172a; display: flex; align-items: center; justify-content: center;
}
.end-logo-box:hover { border-color: #f59e0b; }
.end-logo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.end-input {
  flex: 1; min-width: 0;
  background: #0f172a; border: 1px solid #1e293b; border-radius: 8px;
  color: #fff; font-size: 12px; padding: 8px 10px; outline: none;
}
.end-input:focus { border-color: #f59e0b; }
.end-del {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.25);
  color: #fb7185; cursor: pointer; font-size: 12px;
}
.end-del:hover { background: rgba(244,63,94,.25); }
.end-add {
  width: 100%; margin-top: 8px;
  background: rgba(251,191,36,.08); border: 1px dashed rgba(251,191,36,.4);
  color: #fcd34d; font-size: 12px; font-weight: 600;
  padding: 9px; border-radius: 10px; cursor: pointer;
}
.end-add:hover { background: rgba(251,191,36,.15); }

/* 空态 */
.empty { grid-column: 1 / -1; text-align: center; padding: 80px 0; color: #475569; font-size: 14px; }

/* 提示 */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: #1e293b; border: 1px solid #334155; color: #fff;
  font-size: 13px; font-weight: 600; padding: 10px 22px; border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5); z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.toast.show { opacity: 1; }
.toast.success { border-color: rgba(52,211,153,.5); color: #34d399; }
.toast.error { border-color: rgba(244,63,94,.5); color: #fb7185; }

/* 顶部板块切换 */
.tabs {
  display: flex;
  gap: 8px;
  padding: 14px 24px 0;
  background: #020617;
  border-bottom: 1px solid #1e293b;
}
.tab {
  border: none;
  background: #0f172a;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  border: 1px solid #1e293b;
  border-bottom: none;
  transition: all .15s ease;
}
.tab:hover { color: #e2e8f0; }
.tab-active {
  background: #fbbf24;
  color: #020617;
  font-weight: 700;
  border-color: #fbbf24;
}

.groups-list-page {
  padding: 16px 24px 48px;
}

/* 社区圈子管理 */
.groups-section {
  margin: 8px 24px 48px;
}
.groups-title {
  font-size: 15px; font-weight: 700; color: #fcd34d;
  padding: 14px 4px 10px;
  border-top: 1px solid #1e293b;
  margin-top: 8px;
}
.groups-list {
  display: flex; flex-direction: column; gap: 10px;
}
.group-row {
  display: flex; align-items: center; gap: 10px;
  background: #0f172a; border: 1px solid #1e293b; border-radius: 12px;
  padding: 10px;
}
.group-row .end-logo-box { width: 52px; height: 52px; border-radius: 999px; }

/* 指数榜单管理 */
.index-row {
  display: flex; align-items: center; gap: 8px;
  background: #0f172a; border: 1px solid #1e293b; border-radius: 12px;
  padding: 10px;
}
.index-rank {
  width: 42px; text-align: center; color: #64748b;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.index-cat {
  width: 88px; flex-shrink: 0;
  background: #020617; border: 1px solid #1e293b; border-radius: 8px;
  color: #fcd34d; font-size: 12px; padding: 8px 6px; outline: none;
}
.index-score {
  width: 110px; color: #fbbf24; font-weight: 700;
  font-family: ui-monospace, monospace;
}

@media (max-width: 640px) {
  .list { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
}
