:root {
  --bg: #0d0f16;
  --bg2: #141724;
  --bg3: #1b1f30;
  --card: #161a29;
  --card-hover: #1c2136;
  --fg: #eceef6;
  --fg2: #9aa2bd;
  --fg3: #6b7394;
  --accent: #ff4d6d;
  --accent2: #ff7a45;
  --accent-grad: linear-gradient(135deg, #ff4d6d 0%, #ff7a45 100%);
  --border: #232840;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font: 15px/1.65 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
img { display: block; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3050; border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }
.no-user-select { user-select: none; }

/* ---------- 顶栏 ---------- */
#topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13, 15, 22, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; height: 60px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 21px; font-weight: 800; letter-spacing: .5px; white-space: nowrap;
}
.logo em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 9px; background: var(--accent-grad);
  color: #fff; font-size: 18px; font-weight: 900;
  box-shadow: 0 4px 14px rgba(255, 77, 109, .4);
}
#catnav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#catnav::-webkit-scrollbar { display: none; }
#catList { display: flex; gap: 4px; align-items: center; height: 60px; }
#catList a {
  display: inline-block; padding: 7px 15px; border-radius: 999px;
  color: var(--fg2); font-size: 14.5px; font-weight: 500; white-space: nowrap;
  transition: color .18s, background .18s;
}
#catList a:hover { color: var(--fg); background: rgba(255, 255, 255, .07); }
#catList a.active { color: #fff; background: var(--accent-grad); box-shadow: 0 3px 12px rgba(255, 77, 109, .35); }
#searchForm { display: flex; align-items: center; background: var(--bg3); border: 1px solid var(--border); border-radius: 999px; padding: 3px 4px 3px 16px; transition: border-color .2s; }
#searchForm:focus-within { border-color: var(--accent); }
#searchInput { width: 190px; background: none; border: 0; outline: 0; color: var(--fg); font-size: 14px; }
#searchInput::placeholder { color: var(--fg3); }
#searchForm button { border: 0; background: var(--accent-grad); width: 32px; height: 32px; border-radius: 50%; font-size: 13px; }

/* ---------- Banner ---------- */
#banner {
  position: relative; overflow: hidden; text-align: center;
  padding: 52px 20px 46px;
  background:
    radial-gradient(ellipse 60% 90% at 20% 0%, rgba(255, 77, 109, .16), transparent),
    radial-gradient(ellipse 50% 80% at 80% 10%, rgba(124, 92, 255, .12), transparent),
    var(--bg2);
  border-bottom: 1px solid var(--border);
}
.banner-glow {
  position: absolute; inset: auto 0 -80px 0; height: 160px;
  background: radial-gradient(ellipse 50% 100% at 50% 0%, rgba(255, 77, 109, .12), transparent);
  pointer-events: none;
}
.banner-title { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.banner-sub { margin: 10px 0 0; font-size: 15px; font-weight: 400; color: var(--fg2); letter-spacing: 2px; }

/* ---------- 布局 ---------- */
#layout {
  max-width: 1280px; margin: 0 auto; padding: 28px 20px 40px;
  display: grid; grid-template-columns: 1fr 300px; gap: 28px;
  align-items: start;
}
#main { min-width: 0; }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.section-title { margin: 0; font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--accent-grad); }
.section-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; transition: transform .22s ease, box-shadow .22s ease, border-color .22s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #343b5e; }
.cover {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: linear-gradient(135deg, #1d2236, #14172a);
}
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .cover img { transform: scale(1.06); }
.cover .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; color: #39406a; }
.card .hot {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-grad); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 3px 10px rgba(255, 77, 109, .45);
}
.card .chip {
  position: absolute; bottom: 10px; left: 10px; z-index: 2;
  padding: 2px 10px; border-radius: 999px;
  background: rgba(10, 12, 20, .72); backdrop-filter: blur(6px);
  color: #dfe3f5; font-size: 12px;
}
.card .shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 10, 18, .8));
}
.card .body { padding: 12px 14px 13px; }
.card .title {
  margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.5;
  color: var(--fg);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.9em;
  transition: color .18s;
}
.card:hover .title { color: #ff8fa3; }
.card .meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--fg3); }

/* ---------- 分页 ---------- */
#pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 28px; }
.pager-btn {
  padding: 9px 22px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--fg2); transition: all .18s;
}
.pager-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--fg); }
.pager-btn:disabled { opacity: .35; cursor: default; }
#pageInfo { font-size: 14px; color: var(--fg2); min-width: 70px; text-align: center; }

/* ---------- 内容页 ---------- */
.back { display: inline-block; margin-bottom: 16px; color: var(--fg2); font-size: 14px; transition: color .18s; }
.back:hover { color: var(--accent); }
#postView h1 { margin: 4px 0 12px; font-size: 24px; line-height: 1.4; }
#postMeta { display: flex; gap: 10px; margin-bottom: 20px; }
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: rgba(255, 77, 109, .14); color: #ff8fa3;
  font-size: 12.5px; border: 1px solid rgba(255, 77, 109, .3);
}
#postMeta .date { color: var(--fg3); font-size: 13px; align-self: center; }
#playerWrap { border-radius: var(--radius); overflow: hidden; background: #000; margin-bottom: 18px; border: 1px solid var(--border); }
#player { width: 100%; max-height: 560px; display: block; }
.empty { color: var(--fg3); }

/* 正文：图片墙 + 文字 */
#postGallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 22px;
}
#postGallery .gallery-item {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--card);
  cursor: zoom-in;
}
#postGallery img { width: 100%; display: block; min-height: 120px; object-fit: cover; }
#postGallery .gallery-item.expanded { grid-column: 1 / -1; cursor: zoom-out; }
#postGallery .gallery-item.expanded img { max-height: 86vh; object-fit: contain; }
#postText { color: var(--fg2); line-height: 1.9; font-size: 15.5px; }
#postText p { margin: 0 0 14px; }
#postText h2 {
  margin: 22px 0 12px; font-size: 18px; color: var(--fg);
  padding-left: 10px; border-left: 3px solid var(--accent);
}
#postText blockquote {
  margin: 0 0 14px; padding: 10px 14px;
  border-left: 3px solid var(--border); background: rgba(255, 255, 255, .03);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--fg3);
}

/* ---------- 侧栏 ---------- */
#aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 20px; }
.widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.widget-title {
  margin: 0 0 14px; font-size: 15.5px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.widget-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-grad); box-shadow: 0 0 8px rgba(255, 77, 109, .8); }
.side-list.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.side-list.cats a {
  padding: 5px 13px; border-radius: 999px; font-size: 13px; color: var(--fg2);
  background: var(--bg3); border: 1px solid var(--border); transition: all .18s;
}
.side-list.cats a:hover { color: #fff; border-color: var(--accent); }
.side-list.cats a.active { color: #fff; background: var(--accent-grad); border-color: transparent; }
.side-list.hot li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.side-list.hot li:last-child { border-bottom: 0; }
.side-list.hot .rank {
  flex: none; width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--fg3); background: var(--bg3);
  transform: translateY(3px);
}
.side-list.hot li:nth-child(1) .rank { background: var(--accent-grad); color: #fff; }
.side-list.hot li:nth-child(2) .rank { background: rgba(255, 122, 69, .8); color: #fff; }
.side-list.hot li:nth-child(3) .rank { background: rgba(255, 170, 60, .7); color: #fff; }
.side-list.hot a {
  color: var(--fg2); font-size: 13.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .18s;
}
.side-list.hot a:hover { color: var(--fg); }

/* ---------- 页脚 / 提示 ---------- */
#footer { border-top: 1px solid var(--border); padding: 26px 20px 34px; text-align: center; color: var(--fg3); font-size: 13px; }
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: #262c46; color: var(--fg); border: 1px solid #3a4266;
  padding: 11px 22px; border-radius: 12px; z-index: 200; box-shadow: var(--shadow);
  font-size: 14px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  #layout { grid-template-columns: 1fr; }
  #aside { position: static; }
}
@media (max-width: 680px) {
  .topbar-inner { gap: 12px; padding: 0 14px; }
  #searchForm { display: none; }
  .logo { font-size: 18px; }
  .logo-mark { width: 28px; height: 28px; font-size: 15px; }
  #banner { padding: 34px 16px 30px; }
  .banner-title { font-size: 21px; }
  .banner-sub { font-size: 12.5px; letter-spacing: 1px; }
  #layout { padding: 18px 14px 30px; gap: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card .body { padding: 10px 11px; }
  .card .title { font-size: 13px; }
}
