/* ========================================
   JHD1 Tech Blog - 主样式表
   ======================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #0ea5e9;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-secondary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

/* ========================================
   Header / Navigation
   ======================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

.site-nav {
  display: flex;
  gap: 8px;
}

.site-nav a {
  padding: 8px 16px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e3a5f 100%);
  color: #fff;
  padding: 80px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(14,165,233,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(99,102,241,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.8;
  margin-bottom: 32px;
}

.hero-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tag {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ========================================
   Main Layout
   ======================================== */

.main-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}

.content-area {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
}

/* ========================================
   Article Cards
   ======================================== */

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon {
  color: var(--primary);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow 0.3s, transform 0.2s;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-card .card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.article-card .card-category {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.article-card .card-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.article-card h3 a {
  color: var(--text);
}

.article-card h3 a:hover {
  color: var(--primary);
}

.article-card .card-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.article-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.article-card .read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
}

.article-card .read-more:hover {
  color: var(--primary-dark);
}

/* ========================================
   Sidebar Widgets
   ======================================== */

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-widget h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.sidebar-widget .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-widget .tag-item {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  border: 1px solid var(--border-light);
  transition: all 0.2s;
}

.sidebar-widget .tag-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.sidebar-about {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-about .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-about .about-text h5 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.sidebar-about .about-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-list li {
  font-size: 0.85rem;
}

.recent-list li a {
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.recent-list li a::before {
  content: '→';
  color: var(--primary);
  flex-shrink: 0;
  font-weight: 700;
}

.recent-list li a:hover {
  color: var(--primary);
}

/* ========================================
   Article Page
   ======================================== */

.article-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
}

.article-header {
  margin-bottom: 40px;
}

.article-header .article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-header .article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.article-header .article-tags span {
  background: var(--primary-light);
  color: var(--primary);
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 500;
}

.article-content {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text);
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 12px;
}

.article-content p {
  margin-bottom: 18px;
}

.article-content ul, .article-content ol {
  margin-bottom: 18px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: #e11d48;
  border: 1px solid var(--border-light);
}

.article-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 18px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.article-content pre code {
  background: none;
  padding: 0;
  border: none;
  color: inherit;
  font-size: inherit;
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  margin-bottom: 18px;
  background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
}

.article-content blockquote p {
  margin-bottom: 0;
}

.article-content .highlight-box {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.article-content .highlight-box h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--primary);
}

/* Article navigation */
.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.article-nav a {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ========================================
   About Page
   ======================================== */

.about-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
}

.about-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.about-page .subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 40px;
}

.about-section {
  margin-bottom: 40px;
}

.about-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary);
}

.about-section p {
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 12px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.skill-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.skill-item .skill-icon {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
  padding-left: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item .time {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-item h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
  background: #1e293b;
  color: rgba(255,255,255,0.7);
  padding: 40px 24px 24px;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-col p,
.footer-col a {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  line-height: 1.8;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}

.footer-bottom .icp-info {
  margin-top: 8px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .main-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sidebar {
    position: static;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .article-page,
  .about-page {
    padding: 32px 16px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .article-nav {
    flex-direction: column;
    gap: 12px;
  }
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination .page-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.pagination .page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========================================
   Subscribe Banner
   ======================================== */

.subscribe-banner {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  text-align: center;
}

.subscribe-banner h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.subscribe-banner p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 16px;
}

.subscribe-banner .subscribe-form {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.subscribe-banner input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.subscribe-banner input::placeholder {
  color: rgba(255,255,255,0.5);
}

.subscribe-banner button {
  padding: 10px 24px;
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.subscribe-banner button:hover {
  background: #f1f5f9;
}
