* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #1a0a2e 0%, #3a0a4f 50%, #5a1060 100%);
  min-height: 100vh;
  color: #fff;
  padding-bottom: 40px;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.header {
  padding: 50px 0 30px;
  text-align: center;
  background: rgba(0,0,0,0.2);
  margin-bottom: 30px;
}
.logo {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, #ff6b9d, #ffa07a, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}
.subtitle { font-size: 1.1rem; color: #ffd1e8; margin-bottom: 25px; }

.filter-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.chip {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 8px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s;
}
.chip:hover { background: rgba(255,255,255,0.2); }
.chip.active {
  background: linear-gradient(90deg, #ff6b9d, #ffa07a);
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(255,107,157,0.4);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  padding: 10px 0;
}
.loading { grid-column: 1 / -1; text-align: center; padding: 60px; color: #ffd1e8; font-size: 1.1rem; }

.card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(255,107,157,0.25);
}
.photo-wrap {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #2a1540;
}
.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.card:hover .photo-wrap img { transform: scale(1.06); }
.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: rgba(255,255,255,0.3);
}

.card-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.card-name {
  font-size: 1.3rem;
  font-weight: 700;
}
.card-category {
  background: linear-gradient(90deg, #7c3aed, #ec4899);
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.card-bio {
  color: #d6c8e0;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 15px;
  flex: 1;
}
.vote-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.vote-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffd700;
}
.vote-count small { color: #b8a8c8; font-weight: 400; font-size: 0.8rem; }

.vote-btn {
  background: linear-gradient(90deg, #ff6b9d, #ec4899);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(236,72,153,0.35);
}
.vote-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(236,72,153,0.5);
}
.vote-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.vote-btn.voted { background: linear-gradient(90deg, #10b981, #059669); }

.footer {
  text-align: center;
  padding: 30px 0 10px;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(90deg, #10b981, #059669);
  color: #fff;
  padding: 14px 28px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s;
  font-weight: 500;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* ========== Admin ========== */
.admin-login {
  max-width: 400px;
  margin: 80px auto;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 40px 30px;
}
.admin-login h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #ffd700;
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; color: #e0d0f0; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.2);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border 0.3s;
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: #ff6b9d;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
}
.btn-primary {
  background: linear-gradient(90deg, #ff6b9d, #ec4899);
  color: #fff;
  box-shadow: 0 4px 15px rgba(236,72,153,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(236,72,153,0.5); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; width: auto; border-radius: 8px; }
.btn-danger { background: linear-gradient(90deg, #ef4444, #dc2626); color: #fff; }
.btn-secondary { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.btn-warning { background: linear-gradient(90deg, #f59e0b, #d97706); color: #fff; }
.btn-success { background: linear-gradient(90deg, #10b981, #059669); color: #fff; }

.admin-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}
.admin-header h1 { color: #ffd700; font-size: 1.8rem; }
.admin-actions { display: flex; gap: 10px; }

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 25px;
}
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.panel {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 25px;
}
.panel h3 {
  color: #ffd1e8;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: middle;
  font-size: 0.9rem;
}
th { background: rgba(0,0,0,0.2); color: #ffd700; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.04); }
.mini-photo {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
}
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.preview-box {
  width: 100%;
  max-height: 200px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0,0,0,0.2);
  margin-bottom: 15px;
  display: none;
}
.preview-box.show { display: block; }
.preview-box img { width: 100%; height: 200px; object-fit: contain; }

input[type="file"] {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.3);
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
}

.btn-group { display: flex; gap: 10px; margin-top: 8px; }
.btn-group .btn { flex: 1; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,0.5);
}
