* { box-sizing: border-box; margin: 0; padding: 0; overflow: auto;}

:root {
  --bg: #0e0b1e;
  --bg2: #16122b;
  --card: #1c1838;
  --card-hover: #262050;
  --accent: #7c5cff;
  --accent2: #9d7bff;
  --text: #e8e6f5;
  --muted: #9690b8;
  --border: #2a2550;
}

body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #2a1f5e 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: clamp(14px, 4vw, 24px) clamp(12px, 4vw, 16px) 60px; }

.banner {
  background: linear-gradient(135deg, #6f5bff 0%, #9d7bff 100%);
  border-radius: 18px;
  padding: clamp(28px, 7vw, 48px) clamp(16px, 5vw, 24px);
  text-align: center;
  box-shadow: 0 16px 40px rgba(124, 92, 255, 0.3);
}
.banner h1 { font-size: clamp(24px, 6vw, 40px); font-weight: 800; letter-spacing: 2px; color: #fff; }
.banner .sub {
  display: inline-block;
  margin-top: 18px;
  padding: 10px clamp(28px, 12vw, 60px);
  background: rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  color: #fff;
  font-size: 14px;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}
.notice .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

.search-bar { display: flex; gap: 10px; margin-top: 18px; }
.search-bar input {
  flex: 1;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.search-bar input::placeholder { color: var(--muted); }
.search-bar button {
  padding: 0 32px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.search-bar button:hover { background: var(--accent2); }

.cats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cats button {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.cats button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.panel {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(16px, 4vw, 24px);
}
.panel h2 { font-size: 20px; margin-bottom: 4px; }
.panel .count { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(10px, 2vw, 18px);
}
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  border-color: var(--accent);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media.noimg::after {
  content: attr(data-letter);
  font-size: clamp(36px, 12vw, 56px);
  font-weight: 800;
  color: #fff;
}
.card-media .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 12px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.card .name {
  font-size: 15px;
  font-weight: 700;
  margin-top: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 22px;
}
.card-meta .tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--card-hover);
  border: 1px solid var(--border);
  color: var(--accent2);
}

.visit-btn {
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: filter 0.15s;
}
.visit-btn:hover { filter: brightness(1.1); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.admin-link {
  position: fixed; right: 18px; bottom: 18px;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 20px;
}

/* 小桌面：6 -> 5 列 */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}

/* 大平板：5 -> 4 列 */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

/* 平板：分类横滑 + 4 列保持 */
@media (max-width: 768px) {
  .search-bar button { padding: 0 22px; }
  .cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .cats::-webkit-scrollbar { height: 0; }
  .cats button { flex: 0 0 auto; }
}

/* 小平板：4 -> 3 列，避免卡片过窄 */
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

/* 手机：固定 4 列 */
@media (max-width: 480px) {
  .search-bar { flex-direction: column; }
  .search-bar button { padding: 12px; width: 100%; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .card { padding: 6px; border-radius: 10px; }
  .card .name { font-size: 12px; }
  .card-media { border-radius: 8px; }
  .card-media.noimg::after { font-size: 24px; }
  .card-media .badge { padding: 1px 6px; font-size: 9px; top: 4px; left: 4px; }
  .card .desc { display: none; }
  .card-meta { margin-top: 5px; min-height: 0; }
  .card-meta .tag { font-size: 5px; padding: 2px 6px; }
  .visit-btn { margin-top: 6px; padding: 6px; font-size: 12px; }
  .admin-link { width: 42px; height: 42px; right: 12px; bottom: 12px; }
}

/* 超小屏：保持 4 列但更紧凑，避免内容溢出被遮挡 */
@media (max-width: 360px) {
  .grid { gap: 6px; }
  .card { padding: 5px; }
  .card .name { font-size: 11px; }
  .visit-btn { font-size: 11px; padding: 5px; }
}

/* ===== 公告弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modal-fade 0.3s ease;
  padding: 20px;
}
@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  border-radius: 20px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 50%, #3730a3 100%);
  border: 1px solid rgba(167, 139, 250, 0.35);
  animation: modal-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), purple-breathe 3s 0.35s infinite ease-in-out;
}
@keyframes modal-pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes purple-breathe {
  0%, 100% {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5), 0 0 30px rgba(139, 92, 246, 0.3), inset 0 0 10px rgba(139, 92, 246, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(167, 139, 250, 0.8), 0 0 50px rgba(139, 92, 246, 0.5), inset 0 0 20px rgba(139, 92, 246, 0.4);
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(216, 200, 255, 0.8);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  overflow: clip;
}
.modal-close:hover { color: #fff; }

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(124, 92, 255, 0.35);
  border: 1px solid rgba(167, 139, 250, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.modal-title {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(to right, #ddd6fe, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.modal-divider {
  height: 3px;
  width: 80px;
  margin: 10px auto 20px;
  border-radius: 3px;
  background: linear-gradient(to right, transparent, #a78bfa, transparent);
}
.modal-content {
  font-size: 15px;
  line-height: 1.7;
  color: #00ff2d;
  margin-bottom: 26px;
  white-space: pre-wrap;
  word-break: break-word;
}
.modal-actions { display: flex; justify-content: center; }
.modal-ok {
  padding: 12px 36px;
  border: none;
  border-radius: 30px;
  background: #fff;
  color: #4c1d95;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  transition: transform 0.15s, box-shadow 0.3s;
}
.modal-ok:hover { box-shadow: 0 0 30px rgba(255, 255, 255, 0.55); }
.modal-ok:active { transform: scale(0.95); }

@media (max-width: 480px) {
  .modal-box { padding: 28px 22px; }
  .modal-title { font-size: 22px; }
}


.footer-banquan {
    color: var(--accent2);
    text-align: center;
    font-size: 12px;
    margin: -40px 0px 20px 0px;
}