* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #222;
}
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.topbar h1 {
  grid-column: 2;
  font-size: 18px;
  margin: 0;
  text-align: center;
}
.actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}
.status { font-size: 13px; color: #6b7280; }
.btn {
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.btn:hover { background: #f3f4f6; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: #ff2442;
  border-color: #ff2442;
  color: #fff;
}
.btn-primary:hover { background: #e91f3d; }

.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.tabs-platform { border-bottom: 1px solid #e5e7eb; }
.tab {
  padding: 6px 14px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
}
.tab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.tabs-platform .tab.active { background: #ff2442; border-color: #ff2442; }

main { padding: 16px 24px; }
.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.grid th, .grid td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid #f1f1f1;
  font-size: 14px;
}
.grid th {
  background: #fafbfc;
  font-weight: 600;
  color: #555;
}
.grid th.sortable {
  cursor: pointer;
  user-select: none;
}
.grid th.sortable:hover { background: #f0f2f5; }
.sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  color: #9ca3af;
  vertical-align: middle;
}
.sort-arrow::before { content: '⇅'; }
th.sort-desc .sort-arrow {
  color: #111827;
}
th.sort-desc .sort-arrow::before { content: '▼'; }
th.sort-asc .sort-arrow {
  color: #111827;
}
th.sort-asc .sort-arrow::before { content: '▲'; }
.grid tr:last-child td { border-bottom: none; }
.col-info { text-align: left !important; }
td.col-info { text-align: left; }

.avatar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e5e7eb;
  object-fit: cover;
  flex: 0 0 44px;
}
.name { font-weight: 600; }
.subname { font-size: 12px; color: #9ca3af; }

.empty {
  text-align: center;
  color: #9ca3af;
  padding: 40px 0;
}
.placeholder { color: #9ca3af; }
.failed { color: #dc2626; font-weight: 600; }
.failed-tag {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 6px;
  font-size: 11px;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 4px;
  cursor: help;
}
.row-refresh {
  padding: 4px 10px;
  font-size: 12px;
}
.btn-link {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
}
.btn-link:hover { background: #1d4ed8; }

/* Admin / guest visibility */
body.is-guest .admin-only { display: none !important; }
body.is-admin .guest-only { display: none !important; }

/* Column widths */
.col-w-info     { width: 22%; }
.col-w-operator { width: 12%; }
.col-w-fans     { width: 14%; }
.col-w-likes    { width: 14%; }
.col-w-works    { width: 12%; }
.col-w-link     { width: 14%; }
.col-w-action   { width: 12%; }
