:root {
  --bg: #0f1115;
  --panel: #171a21;
  --card: #1c2029;
  --text: #f2f4f8;
  --muted: #9aa3b2;
  --accent: #ff4d6d;
  --accent2: #2dd4bf;
  --line: rgba(255,255,255,.08);
  --max: 1180px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(15,17,21,.88);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 16px;
}
.logo {
  display: flex; align-items: baseline; gap: 6px; font-weight: 800; letter-spacing: .5px;
  white-space: nowrap;
}
.logo b { color: var(--accent); font-size: 22px; }
.logo span { font-size: 18px; }
.nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.nav a:hover, .nav a.active { color: #fff; }
.actions { margin-left: auto; display: flex; gap: 10px; }
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; font-weight: 700; }
.btn:hover { filter: brightness(1.08); }

.hero {
  max-width: var(--max); margin: 28px auto 8px; padding: 0 16px; text-align: center;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(22px, 4vw, 34px); font-weight: 800; }
.hero p { margin: 0 auto; max-width: 720px; color: var(--muted); line-height: 1.7; font-size: 14px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 18px 16px 60px; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .nav { display: none; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  min-height: 280px;
  display: flex; flex-direction: column;
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(255,77,109,.35); }
.cover {
  position: relative; aspect-ratio: 16/10; background: #12151c;
  overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1a2030, #10131a 60%, #241018);
  color: var(--muted); font-size: 13px; letter-spacing: 1px;
}
.ribbon {
  position: absolute; top: 12px; right: -28px;
  background: var(--accent2); color: #042f2e;
  font-size: 11px; font-weight: 800;
  padding: 4px 34px; transform: rotate(35deg);
}
.meta-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.meta-body h2 {
  margin: 0; font-size: 16px; line-height: 1.45; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sub {
  color: var(--muted); font-size: 12px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.foot {
  margin-top: auto; color: var(--muted); font-size: 12px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.tag {
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px;
}

.site-footer {
  border-top: 1px solid var(--line); color: var(--muted);
  text-align: center; padding: 28px 16px 40px; font-size: 13px; line-height: 1.8;
}
.site-footer a { color: #fff; border-bottom: 1px dashed rgba(255,255,255,.3); }

/* detail drawer */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 80;
  display: none; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.mask.open { display: flex; }
.drawer {
  width: min(760px, 100%); max-height: min(88vh, 920px); overflow: auto;
  background: var(--panel); border-radius: 16px;
  border: 1px solid var(--line); padding: 18px 18px 28px;
}
body.modal-open { overflow: hidden; }
.drawer .gallery { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
.drawer .gallery img { width: 100%; height: auto; display: block; border-radius: 10px; background: #0c0e13; }
.drawer h3 { margin: 0 0 10px; font-size: 20px; }
.drawer .close {
  float: right; border: 0; background: transparent; color: var(--muted);
  font-size: 22px; cursor: pointer;
}
.drawer .body { white-space: pre-wrap; line-height: 1.75; color: #dbe1ea; font-size: 14px; }
.drawer .links { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

.cover.multi { aspect-ratio: auto; background: #0c0e13; }
.mosaic { display: grid; gap: 2px; width: 100%; }
.mosaic.g2 { grid-template-columns: 1fr 1fr; }
.mosaic.g4 { grid-template-columns: 1fr 1fr; }
.mosaic.g6 { grid-template-columns: repeat(3, 1fr); }
.mosaic.g8 { grid-template-columns: repeat(4, 1fr); }
.mosaic img { width: 100%; height: 92px; object-fit: cover; aspect-ratio: auto; }
.mosaic.g2 img { height: 140px; }
.drawer .mosaic { margin-bottom: 12px; grid-template-columns: 1fr !important; }
.drawer .mosaic img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: #0c0e13;
}

.search {
  display: flex; gap: 8px; max-width: 680px; margin: 0 auto 4px;
}
.search input {
  flex: 1; min-width: 0;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 11px 16px; font-size: 15px; outline: none;
  font-family: inherit;
}
.search input::placeholder { color: #6d7686; }
.search input:focus { border-color: rgba(255,77,109,.55); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.hints {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin: 10px 0 0;
}
.hints button {
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--muted); border-radius: 999px; padding: 5px 12px;
  font-size: 13px; cursor: pointer; font-family: inherit;
}
.hints button:hover, .hints button.on {
  color: #fff; border-color: rgba(255,77,109,.45); background: rgba(255,77,109,.12);
}
.search-meta {
  text-align: center; color: var(--muted); font-size: 13px;
  min-height: 18px; margin: 10px 0 14px;
}

.more-wrap { display: flex; justify-content: center; margin: 8px 0 20px; }
.more-wrap .btn { min-width: 160px; }

.card .full { display: none; }
.card.open .full { display: block; }
.card.open .sub { display: none; }
.full-imgs { display: flex; flex-direction: column; gap: 8px; padding: 0 0 4px; }
.full-imgs img { width: 100%; height: auto; display: block; }
.full-body {
  white-space: pre-wrap;
  line-height: 1.75;
  color: #e7edf6;
  font-size: 15px;
  padding: 4px 14px 8px;
}
