/* ============================================
   Zzyhh Blog - 深色简约主题
   ============================================ */

/* CSS 变量 */
:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --bg-card: #1c2129;
  --border: #30363d;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-dim: #2f81f7;
  --code-bg: #0d1117;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
}

/* 基础重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #79c0ff; }

img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============================================
   顶部导航
   ============================================ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex; justify-content: space-between; align-items: center;
  height: 64px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; color: var(--text);
}
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #bc8cff);
  font-size: 16px;
}
.logo-text .dot { color: var(--accent); }

.nav { display: flex; gap: 8px; }
.nav-link {
  padding: 8px 16px; border-radius: 6px;
  color: var(--text-secondary); font-size: 14px;
  transition: all var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--bg-alt); }
.nav-link.active { color: var(--accent); background: rgba(88,166,255,0.1); }

/* ============================================
   Hero Banner
   ============================================ */
.hero {
  position: relative; overflow: hidden;
  padding: 80px 0 60px;
  background: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
}
.hero-small { padding: 60px 0 40px; }

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(88,166,255,0.15), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(188,140,255,0.12), transparent 50%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero-title {
  font-size: 48px; font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff, var(--accent), #bc8cff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-small .hero-title { font-size: 36px; }
.hero-title .accent {
  background: linear-gradient(135deg, var(--accent), #bc8cff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: 18px; color: var(--text-secondary); margin-bottom: 28px;
}
.hero-meta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.2);
  font-size: 14px; color: var(--text-secondary);
}
.chip b { color: var(--accent); }

/* ============================================
   主体布局
   ============================================ */
.main {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding: 40px 24px 80px;
}

.section-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 20px; font-weight: 600; margin-bottom: 24px;
}
.section-title .bar {
  width: 4px; height: 20px; border-radius: 2px;
  background: linear-gradient(var(--accent), #bc8cff);
}

/* ============================================
   文章卡片列表
   ============================================ */
.article-list { display: flex; flex-direction: column; gap: 16px; }

.article-card {
  padding: 28px; border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}
.article-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.article-card h3 {
  font-size: 20px; font-weight: 600; margin-bottom: 10px;
}
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--accent); }
.article-card .excerpt {
  color: var(--text-secondary); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}
.article-card .card-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; color: var(--text-secondary); flex-wrap: wrap;
}
.article-card .cat-tag {
  font-size: 12px; padding: 3px 10px;
  background: rgba(88,166,255,0.12); color: var(--accent);
  border-radius: 999px;
}

/* ============================================
   侧边栏
   ============================================ */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; margin-bottom: 20px;
}
.card-title {
  font-size: 15px; font-weight: 600; margin-bottom: 16px;
  color: var(--text);
}

/* Profile */
.profile-card { text-align: center; padding: 28px 22px; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, rgba(88,166,255,0.2), rgba(188,140,255,0.2));
  border: 2px solid var(--border);
}
.profile-name { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.profile-bio { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.profile-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.profile-links a { font-size: 13px; }

/* 标签云 */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--bg-alt); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.tag:hover { color: var(--accent); border-color: var(--accent); }

/* 分类列表 */
.cat-list { list-style: none; }
.cat-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.cat-list li:last-child { border-bottom: none; }
.cat-list li a { color: var(--text-secondary); flex: 1; }
.cat-list li a:hover { color: var(--accent); }
.cat-list li .count {
  font-size: 12px; padding: 2px 10px; border-radius: 999px;
  background: var(--bg-alt); color: var(--text-secondary);
}

/* ============================================
   文章详情页
   ============================================ */
.article-main { max-width: 800px; margin: 0 auto; display: block; }

.back-btn {
  display: inline-block; margin-bottom: 24px;
  font-size: 14px; color: var(--text-secondary);
}
.back-btn:hover { color: var(--accent); }

.article-header { margin-bottom: 36px; }
.cat-tag {
  display: inline-block; font-size: 12px;
  padding: 4px 14px; border-radius: 999px;
  background: rgba(88,166,255,0.12); color: var(--accent);
  margin-bottom: 16px;
}
.article-title {
  font-size: 32px; font-weight: 700; line-height: 1.3;
  margin-bottom: 16px;
}
.article-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 16px;
}

.article-body { font-size: 17px; line-height: 1.9; }
.article-body p { margin-bottom: 20px; }
.article-body h2 {
  font-size: 24px; font-weight: 600; margin: 40px 0 16px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.article-body h3 { font-size: 20px; font-weight: 600; margin: 30px 0 14px; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 20px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  padding: 16px 24px; border-left: 4px solid var(--accent);
  background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px; color: var(--text-secondary);
}
.article-body code {
  padding: 2px 6px; border-radius: 4px;
  background: var(--bg-alt); color: var(--accent);
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.9em;
}
.article-body pre {
  padding: 20px; border-radius: var(--radius);
  background: var(--code-bg); border: 1px solid var(--border);
  overflow-x: auto; margin-bottom: 20px;
}
.article-body pre code {
  background: none; padding: 0; color: var(--text); font-size: 14px;
}

.article-footer { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.like-box {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 24px; border-radius: 999px;
  border: 1px solid var(--border); cursor: pointer;
  transition: all var(--transition);
}
.like-box:hover { border-color: #f85149; color: #f85149; }
.like-box.liked { border-color: #f85149; color: #f85149; }

/* ============================================
   关于页
   ============================================ */
.about-main { max-width: 800px; margin: 0 auto; display: block; padding-top: 24px; }
.about-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 48px; text-align: center;
}
.about-avatar {
  width: 120px; height: 120px; border-radius: 50%;
  margin: 0 auto 20px; font-size: 56px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(88,166,255,0.2), rgba(188,140,255,0.2));
  border: 2px solid var(--border);
}
.about-card h2 { font-size: 28px; margin-bottom: 8px; }
.about-tagline { color: var(--text-secondary); margin-bottom: 40px; }

.about-section { text-align: left; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.about-section h3 { font-size: 18px; margin-bottom: 16px; }

.skill-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.skill {
  padding: 6px 16px; border-radius: 6px;
  background: var(--bg-alt); border: 1px solid var(--border);
  font-size: 14px;
}
.bullet-list { padding-left: 20px; }
.bullet-list li { margin-bottom: 10px; }
.contact-list { display: flex; flex-direction: column; gap: 10px; }

/* ============================================
   分类页
   ============================================ */
.cat-full { display: flex; flex-direction: column; gap: 40px; }
.cat-block h2 {
  font-size: 22px; margin-bottom: 20px; padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.cat-block h2 .count {
  font-size: 14px; font-weight: 400;
  color: var(--text-secondary);
  background: var(--bg-alt); padding: 4px 12px; border-radius: 999px;
}

/* ============================================
   页脚
   ============================================ */
.footer {
  padding: 32px 0; border-top: 1px solid var(--border);
  text-align: center; color: var(--text-secondary);
  font-size: 14px;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; padding: 24px 16px 60px; }
  .sidebar { order: -1; }
  .hero { padding: 60px 0 40px; }
  .hero-title { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .article-card { padding: 20px; }
  .article-title { font-size: 26px; }
  .about-card { padding: 32px 24px; }
  .nav { gap: 4px; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }
