:root {
  --red: #ff2442;
  --red-soft: #fff1f2;
  --ink: #1f1f1f;
  --sub: #667085;
  --line: #ececec;
  --bg: #f5f6f8;
  --card: #fff;
  --sidebar: #111;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1a1a1a, #3a1018 60%, #ff2442);
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.brand { font-size: 28px; font-weight: 800; color: var(--red); }
.login-card h2 { margin: 8px 0 24px; font-size: 16px; font-weight: 500; color: var(--sub); }
.login-card label { display: block; font-size: 13px; color: var(--sub); margin: 12px 0 6px; }
.login-card input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 14px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; border: 0; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.btn-red { background: var(--red); color: #fff; width: 100%; height: 44px; margin-top: 20px; font-weight: 700; }
.btn-ghost { background: #f4f4f4; color: #333; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.hint { margin-top: 14px; font-size: 12px; color: #999; text-align: center; }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--sidebar); color: #fff; padding: 24px 14px; flex-shrink: 0;
}
.sidebar .logo { font-size: 22px; font-weight: 800; color: var(--red); padding: 0 10px 20px; }
.nav-item {
  display: block; padding: 10px 12px; border-radius: 10px; color: #cfcfcf; margin-bottom: 4px; cursor: pointer;
}
.nav-item.active, .nav-item:hover { background: #222; color: #fff; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; background: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; border-bottom: 1px solid var(--line);
}
.topbar .who { font-size: 13px; color: var(--sub); }
.content { padding: 24px; }
h1 { font-size: 20px; margin: 0 0 16px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.stat .k { color: var(--sub); font-size: 13px; }
.stat .v { font-size: 28px; font-weight: 800; margin-top: 6px; }
.stat .v.red { color: var(--red); }

.panel { background: #fff; border-radius: var(--radius); padding: 16px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--sub); font-weight: 600; }
.cover { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: #eee; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #eee; vertical-align: middle; margin-right: 8px; }
.tag { display: inline-block; background: #f5f5f5; border-radius: 6px; padding: 2px 8px; margin-right: 4px; font-size: 12px; }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.green { background: #e8f8ef; color: #12b76a; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pager { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; align-items: center; color: var(--sub); font-size: 13px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 20;
}
.modal {
  width: 560px; max-width: 92vw; max-height: 86vh; overflow: auto; background: #fff; border-radius: 16px; padding: 20px 22px 16px;
}
.modal h3 { margin: 0 0 12px; }
.form-row { margin-bottom: 10px; }
.form-row label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px;
}
.form-row select { height: 40px; background: #fff; }
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.media-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}
.media-card img,
.media-card video {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #111;
  display: block;
}
.media-card .meta { padding: 10px 12px 12px; }
.media-card .name {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-card .sub { font-size: 12px; color: var(--sub); margin: 6px 0 8px; }
.media-card .actions { display: flex; gap: 6px; }
.form-row textarea { min-height: 90px; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.empty { text-align: center; color: #999; padding: 40px; }

@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 180px; }
}
