:root {
  --bg: #070b13;
  --fg: #e8eefc;
  --muted: #8b9ab6;
  --line: rgba(148, 163, 184, 0.14);
  --card: rgba(148, 163, 184, 0.07);
  --card-hover: rgba(148, 163, 184, 0.14);
  --accent: #5eead4;
  --accent-2: #818cf8;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ---------- 背景 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 8% -10%, #16233d 0%, transparent 55%),
    radial-gradient(90% 80% at 100% 0%, #1b1b3d 0%, transparent 50%),
    linear-gradient(180deg, #0a1120 0%, #070b13 60%, #05080f 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}

.b1 {
  width: 46vw; height: 46vw;
  left: -12vw; top: -14vw;
  background: radial-gradient(circle, rgba(94, 234, 212, .30), transparent 65%);
}

.b2 {
  width: 40vw; height: 40vw;
  right: -10vw; top: 6vh;
  background: radial-gradient(circle, rgba(129, 140, 248, .32), transparent 65%);
}

.b3 {
  width: 52vw; height: 52vw;
  left: 28vw; bottom: -34vw;
  background: radial-gradient(circle, rgba(56, 189, 248, .18), transparent 65%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 布局 ---------- */
.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 11, 19, .55);
  border-bottom: 1px solid rgba(148, 163, 184, .08);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #04211d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px rgba(94, 234, 212, .22);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.brand-text em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.clock { text-align: right; display: flex; flex-direction: column; line-height: 1.2; }
.clock strong { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clock em { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* ---------- 搜索 ---------- */
.hero { padding: 40px 0 8px; }

.searchbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 54px;
  border-radius: 16px;
  background: rgba(148, 163, 184, .07);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color .18s, background .18s;
}

.searchbox:focus-within {
  border-color: rgba(94, 234, 212, .45);
  background: rgba(148, 163, 184, .1);
}

.searchbox svg {
  width: 19px; height: 19px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.searchbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font-size: 15px;
  font-family: inherit;
}

.searchbox input::placeholder { color: #66748f; }
.searchbox input::-webkit-search-cancel-button { display: none; }

kbd {
  flex: none;
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
}

.hint {
  margin: 12px 2px 0;
  font-size: 12.5px;
  color: #6b7891;
}

/* ---------- 分组 ---------- */
.section { margin-top: 34px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #cbd6ea;
}

.section-head span {
  font-size: 12px;
  color: #5d6a83;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

/* ---------- 卡片 ---------- */
.card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.card:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  border-color: rgba(94, 234, 212, .32);
  box-shadow: 0 10px 30px rgba(3, 8, 18, .45);
}

.card:focus-visible {
  outline: 2px solid rgba(94, 234, 212, .65);
  outline-offset: 2px;
}

.ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(148, 163, 184, .1);
  border: 1px solid rgba(148, 163, 184, .12);
  color: #cfe6ff;
}

.ico svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card:nth-child(3n+1) .ico { color: #9ff5e6; }
.card:nth-child(3n+2) .ico { color: #c3c8ff; }
.card:nth-child(3n) .ico { color: #a8dbff; }

.meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.meta b {
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 56px auto 40px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, .08);
  font-size: 12px;
  color: #5d6a83;
}

.empty {
  margin: 60px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 动效（只动 transform，避免不透明度停留导致整段不可见） ---------- */
@media (prefers-reduced-motion: no-preference) {
  .card { animation: pop .28s ease-out; }
  @keyframes pop {
    from { transform: translateY(4px); }
    to { transform: none; }
  }
}

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { height: 60px; }
  .brand-text em { display: none; }
  .clock strong { font-size: 15px; }
  .hero { padding: 24px 0 4px; }
  .searchbox { height: 48px; }
  kbd { display: none; }
  .section { margin-top: 26px; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .card { padding: 13px 14px; }
  .foot { flex-direction: column; gap: 6px; margin-bottom: 28px; }
}

/* ---------- 数据驱动（v2）---------- */
.sec-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #cbd6ea;
}
.sec-count {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: #8494ad;
  background: rgba(148, 163, 184, .12);
  border-radius: 20px;
  padding: 1px 7px;
}

.body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.name {
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.desc {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ico-img {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(148, 163, 184, .1);
  border: 1px solid rgba(148, 163, 184, .12);
  padding: 3px;
}

.card.hide, .section.hide { display: none; }

/* ---------- 壁纸（后台可上传）---------- */
.bg.has-wall {
  background-image:
    linear-gradient(180deg, rgba(5, 9, 17, .78) 0%, rgba(5, 9, 17, .86) 55%, rgba(5, 9, 17, .94) 100%),
    var(--wall);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
.bg.has-wall .blob,
.bg.has-wall .grain { display: none; }
.bg.has-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 10% 0%, rgba(13, 22, 40, .55), transparent 60%);
}

/* ---------- 实心卡片模式 ---------- */
body.solid .card {
  background: rgba(12, 19, 32, .72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
body.solid .card:hover { background: rgba(18, 27, 44, .86); }
