/* ===== 程序喵豆豆 CoderMeme 静态 Demo 样式 =====
   设计基准：localhost:5180 深色主题（2026-10-11 截图还原） */

:root {
  --bg: #0b111e;
  --bg-soft: #0e1524;
  --card: #151d2e;
  --card-2: #101827;
  --border: rgba(255, 255, 255, 0.07);
  --text: #e8edf5;
  --text-2: #97a3b6;
  --text-3: #6b7688;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-text: #6ea8ff;
  --orange: #f97316;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

html.light {
  --bg: #f4f6fa;
  --bg-soft: #eef1f7;
  --card: #ffffff;
  --card-2: #f2f4f9;
  --border: rgba(15, 23, 42, 0.08);
  --text: #1a2333;
  --text-2: #55617a;
  --text-3: #8b95a9;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --accent-text: #2563eb;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  transition: background 0.25s, color 0.25s;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.brand img { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--accent-soft); }
.brand-name { font-size: 16px; font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: 1px; }

.search {
  flex: 1; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 16px; color: var(--text-3);
  font-size: 13px;
}
.search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 13px;
}
.search input::placeholder { color: var(--text-3); }

.theme-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card-2);
  color: var(--text-2); font-size: 15px;
  display: grid; place-items: center;
  transition: transform 0.2s;
}
.theme-btn:hover { transform: rotate(20deg); color: var(--accent-text); }

/* ===== 布局 ===== */
.layout { display: flex; max-width: 1440px; margin: 0 auto; }

.sidebar {
  width: 230px; flex-shrink: 0;
  padding: 20px 14px;
  position: sticky; top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
}
.side-nav a, .side-cats a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); font-size: 14px; margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.side-nav a:hover, .side-cats a:hover { background: var(--card-2); color: var(--text); }
.side-nav a.active { background: var(--accent); color: #fff; }
.side-cats a.active { background: var(--accent-soft); color: var(--accent-text); }
.side-label {
  font-size: 11px; color: var(--text-3); letter-spacing: 2px;
  margin: 18px 12px 8px;
}
.side-quote {
  margin-top: auto; padding: 14px 12px 6px;
  font-size: 12px; color: var(--text-3); line-height: 1.8;
}
.side-quote em { font-style: normal; color: var(--text-2); }

.main { flex: 1; min-width: 0; padding: 20px; }

/* ===== Banner ===== */
.banner {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 18px;
}
.banner img { width: 100%; height: auto; }

/* ===== 信息流 ===== */
.home-cols { display: flex; gap: 18px; align-items: flex-start; }
.feed { flex: 1; min-width: 0; }

.chips {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.chip {
  padding: 6px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px;
  transition: all 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--accent-text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips .sort { margin-left: auto; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }

.post-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  margin-bottom: 14px;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(59, 130, 246, 0.35); }

.post-chips { display: flex; gap: 6px; margin-bottom: 10px; }
.tag-chip {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
}
.tag-chip.top { background: rgba(249, 115, 22, 0.15); color: var(--orange); font-weight: 600; }
.tag-chip.plain { background: var(--card-2); color: var(--text-3); }

.post-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.post-title a:hover { color: var(--accent-text); }
.post-summary { font-size: 13.5px; color: var(--text-2); margin-bottom: 10px; }
.post-tags { display: flex; gap: 12px; margin-bottom: 12px; }
.post-tags a { font-size: 12.5px; color: var(--accent-text); }
.post-tags a:hover { text-decoration: underline; }

.post-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 12.5px; color: var(--text-3);
  border-top: 1px solid var(--border); padding-top: 12px;
}
.post-meta .date { margin-left: auto; }

.post-with-cover { display: flex; gap: 16px; }
.post-with-cover .cover {
  width: 168px; height: 112px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
}
.post-with-cover .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.post-card:hover .cover img { transform: scale(1.05); }
.post-with-cover .post-body { flex: 1; min-width: 0; }

.load-more {
  display: block; width: 100%; padding: 12px;
  background: var(--card); border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--text-3); font-size: 13px;
}
.load-more:hover { color: var(--accent-text); border-color: var(--accent-text); }

/* ===== 右侧栏 ===== */
.aside { width: 300px; flex-shrink: 0; }
.side-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.profile { text-align: center; }
.profile img { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; border: 3px solid var(--accent-soft); }
.profile h3 { font-size: 16px; }
.profile .sub { font-size: 11px; color: var(--text-3); letter-spacing: 1px; margin-bottom: 8px; }
.profile p { font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; }
.profile-stats { display: flex; border-top: 1px solid var(--border); padding-top: 12px; }
.profile-stats div { flex: 1; }
.profile-stats b { display: block; font-size: 17px; }
.profile-stats span { font-size: 11px; color: var(--text-3); }

.side-card h4 {
  font-size: 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.side-card h4 .hash { color: var(--accent-text); }
.hot-item { display: flex; gap: 10px; padding: 8px 0; align-items: baseline; }
.hot-item + .hot-item { border-top: 1px solid var(--border); }
.hot-rank {
  width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 12px; font-weight: 700; text-align: center; line-height: 20px;
}
.hot-item a { font-size: 13px; color: var(--text-2); flex: 1; }
.hot-item a:hover { color: var(--accent-text); }
.hot-item .views { font-size: 11px; color: var(--text-3); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  font-size: 12px; padding: 4px 10px; border-radius: 8px;
  background: var(--card-2); color: var(--text-2);
  border: 1px solid var(--border);
}
.tag-cloud a:hover { color: var(--accent-text); border-color: var(--accent-text); }
.tag-cloud b { color: var(--text-3); font-weight: 400; font-size: 11px; }

/* ===== 特性四卡 ===== */
.features {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 24px;
}
.feature {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.feature .ico { font-size: 22px; margin-bottom: 8px; }
.feature b { font-size: 14px; display: block; margin-bottom: 4px; }
.feature p { font-size: 12px; color: var(--text-3); }

/* ===== 页脚 ===== */
.footer {
  margin-top: 28px; padding: 26px 20px;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 12.5px; color: var(--text-3);
}
.footer .line + .line { margin-top: 6px; }
.footer a:hover { color: var(--accent-text); }
.footer .beian a { color: var(--text-3); border-bottom: 1px dotted var(--text-3); }
.footer .beian a:hover { color: var(--accent-text); border-color: var(--accent-text); }
.footer .beian img { display: inline-block; height: 18px; width: auto; vertical-align: -4px; border: 0; margin: 0 2px; }

/* ===== 详情页 ===== */
.detail-wrap { max-width: 860px; margin: 0 auto; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-3); margin-bottom: 14px;
}
.back-link:hover { color: var(--accent-text); }

.detail-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 38px;
}

.detail-meta { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-3); margin: 10px 0 6px; }

.md h2 {
  font-size: 19px; margin: 28px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.md p { font-size: 14.5px; color: var(--text-2); margin-bottom: 12px; }
.md ol, .md ul { padding-left: 24px; margin-bottom: 12px; }
.md li { font-size: 14.5px; color: var(--text-2); margin-bottom: 8px; }
.md li b, .md p b { color: var(--text); }
.md blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 16px; border-radius: 0 10px 10px 0;
  font-size: 13.5px; color: var(--text-2); margin-bottom: 12px;
}
.md .codeblock { position: relative; margin-bottom: 12px; }
.md pre {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; overflow-x: auto;
  font-size: 13px; color: var(--text-2); line-height: 1.7;
  white-space: pre-wrap;
}
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  font-size: 11px; padding: 3px 10px; border-radius: 6px;
  background: var(--card-2); border: 1px solid var(--border);
  color: var(--text-3);
}
.copy-btn:hover { color: var(--accent-text); border-color: var(--accent-text); }

.action-bar {
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--border); margin-top: 26px; padding-top: 18px;
  font-size: 13px; color: var(--text-3);
}
.action-bar .views { margin-left: auto; }

/* ===== 图片画廊 ===== */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 20px; }
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; height: 300px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border);
  cursor: zoom-in; transition: transform 0.25s;
}
.gallery img:hover { transform: scale(1.02); }
.gallery figcaption { font-size: 11.5px; color: var(--text-3); margin-top: 6px; text-align: center; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  display: none; place-items: center; cursor: zoom-out;
}
.lightbox.show { display: grid; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 10px; }

/* ===== 返回顶部 ===== */
.back-top {
  position: fixed; right: 26px; bottom: 30px; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-2); font-size: 16px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover { color: var(--accent-text); border-color: var(--accent-text); }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .aside { display: none; }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .brand { min-width: 0; }
  .gallery { grid-template-columns: 1fr; }
  .post-with-cover { flex-direction: column; }
  .post-with-cover .cover { width: 100%; height: 170px; }
  .detail-card { padding: 22px 18px; }
  .features { grid-template-columns: 1fr; }
}
