:root {
  --glass: rgba(42, 42, 42, 0.42);
  --glass-strong: rgba(20, 24, 34, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #4f6ef7;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff;
  background: #0b1220;
}

/* 背景：原主题的壁纸 + 暗色压层；图片加载失败时仍有渐变兜底 */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(6, 10, 20, 0.62), rgba(6, 10, 20, 0.78)),
    url("https://img.chaoman.dpdns.org/file/wallpaper/7PH3ljut.webp") center / cover no-repeat fixed,
    radial-gradient(900px 500px at 15% 0%, rgba(79, 110, 247, 0.35), transparent 60%),
    linear-gradient(160deg, #0f172a, #0b1220);
}

.wrap { width: min(1280px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar-inner { display: flex; align-items: center; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand img { height: 30px; width: auto; display: block; }
.brand img[hidden] { display: none; }

.hero { padding: 54px 0 8px; text-align: center; }

.clock {
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 800;
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  margin-bottom: 24px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  padding: 6px 8px 6px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}
.search select { border: 0; background: transparent; color: #0f172a; font-size: 14px; padding: 6px 2px; outline: none; cursor: pointer; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 16px; padding: 10px 6px; background: transparent; color: #0f172a; }
.search button {
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 0; border-radius: 999px; background: var(--accent); color: #fff; cursor: pointer;
  transition: 0.15s;
}
.search button:hover { filter: brightness(1.08); }

.notice {
  max-width: 760px; margin: 18px auto 0; padding: 10px 16px; border-radius: 12px;
  background: rgba(255, 236, 179, 0.14); border: 1px solid rgba(255, 214, 102, 0.35);
  color: #ffe7a8; font-size: 14px; text-align: left;
}

/* 分类选项卡（与原主题一致：玻璃胶囊，当前项更亮） */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 46px 0 30px;
}
.tab {
  padding: 8px 22px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  border: 0;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.tab:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.tab.active { background: rgba(255, 255, 255, 0.22); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }

/* 站点卡片（原主题 nav-card：深色半透明、50px 图标、悬停光晕） */
.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: #fff;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  background: var(--glass-strong);
  box-shadow: 0 0 20px 10px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.icon {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}
.icon img { width: 100%; height: 100%; object-fit: fill; display: block; }

.text { flex: 1; min-width: 0; margin-left: 10px; }
.title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desc {
  margin-top: 2px; font-size: 12px; color: rgba(255, 255, 255, 0.6); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.loading, .empty { text-align: center; color: rgba(255, 255, 255, 0.66); padding: 70px 0; font-size: 14px; }

.footer { padding: 22px 0 40px; text-align: center; color: rgba(255, 255, 255, 0.42); font-size: 12px; }

@media (max-width: 1180px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 920px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .wrap { width: calc(100% - 24px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hero { padding-top: 34px; }
  .tabs { margin: 30px 0 22px; gap: 8px; }
  .tab { padding: 7px 16px; font-size: 13px; }
  .desc { display: none; }
}
@media (max-width: 420px) { .grid { grid-template-columns: 1fr; } .desc { display: block; } }
