:root {
  --bg: #1a1c1e;
  --panel: #232629;
  --text: #e2e2e2;
  --muted: #9aa0a6;
  --primary: #a78bfa;
  --border: #333639;
  --radius: 12px;
  --maxw: 1100px;
}

body.light {
  --bg: #fdfcf8;
  --panel: #ffffff;
  --text: #2c3e50;
  --muted: #8e9aaf;
  --primary: #7c3aed;
  --border: #f1f0e8;
}

body {
  margin: 0; background-color: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, sans-serif; line-height: 1.8;
  transition: background 0.3s;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px; }

header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.nav { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: bold; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

.btn-theme { 
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 13px;
}

/* 布局固定 */
.layout { display: flex; gap: 50px; align-items: flex-start; }
.sidebar { width: 240px; flex-shrink: 0; position: sticky; top: 100px; }
.content-area { flex: 1; min-width: 0; }

.avatar { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--border); margin-bottom: 15px; }
.name { font-size: 22px; margin: 0; }
.bio { font-size: 14px; color: var(--muted); margin-bottom: 25px; }
.links a { margin-right: 15px; font-size: 13px; color: var(--primary); text-decoration: none; }

.tag { 
  border: 1px solid var(--border); background: var(--panel); color: var(--muted); 
  padding: 5px 14px; font-size: 12px; border-radius: 20px; cursor: pointer; margin: 0 8px 8px 0;
}
.tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 卡片 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: transform 0.2s; }
.card:hover { transform: translateY(-5px); }
.thumb { aspect-ratio: 16/9; background: #222; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.content { padding: 20px; }
.title { font-size: 18px; margin: 0 0 10px; }
.desc { font-size: 14px; color: var(--muted); height: 40px; overflow: hidden; }

/* 文章详情 */
#articleScene { max-width: 800px; margin: 0 auto; animation: fadeIn 0.4s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }

.article h1, .article h2 { margin-top: 40px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.article p { margin-bottom: 24px; }
.article a { color: var(--primary); text-decoration: none; border-bottom: 1px solid transparent; }
.article a:hover { border-bottom-color: var(--primary); }
.article blockquote { border-left: 4px solid var(--primary); padding-left: 20px; color: var(--muted); margin: 20px 0; }
.post-img { max-width: 100%; border-radius: 8px; margin: 20px 0; display: block; }

/* 代码块 */
.article pre { 
  background: #282c34; color: #abb2bf; padding: 20px; border-radius: 8px; 
  position: relative; overflow-x: auto; margin: 24px 0; 
}
.article code { font-family: monospace; font-size: 14px; padding-right: 50px; display: block; }
.copy-btn { 
  position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.1);
  color: #fff; border: none; padding: 4px 8px; border-radius: 4px; font-size: 10px; 
  cursor: pointer; opacity: 0; transition: 0.2s;
}
pre:hover .copy-btn { opacity: 1; }

/* 搜索框 */
.search { background: var(--panel); border: 1px solid var(--border); padding: 10px 20px; border-radius: 30px; display: flex; align-items: center; margin-bottom: 40px; }
.search input { background: none; border: none; color: var(--text); outline: none; margin-left: 10px; width: 100%; }

/* 图片弹窗 */
.img-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; cursor: zoom-out; }
.img-modal img { max-width: 90%; max-height: 90%; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; position: static; margin-bottom: 30px; text-align: center; }
}

