
:root {
  --primary: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #0d9488;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.18rem;
  color: #0f172a;
}

.brand-badge {
  background: linear-gradient(135deg, #1d4ed8, #0d9488);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

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

/* Hero */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 100%);
  border-bottom: 1px solid var(--border);
  padding: 54px 24px;
}

.hero-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.hero-text h1 {
  font-size: 2.15rem;
  color: #0f172a;
  line-height: 1.32;
  margin-bottom: 14px;
}

.hero-text p {
  font-size: 1.04rem;
  color: #475569;
  max-width: 660px;
  margin-bottom: 22px;
}

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

.hero-tag {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #334155;
  font-weight: 500;
}

/* Main Grid */
.container {
  max-width: 1140px;
  margin: 36px auto 64px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 32px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Article Grid (2 columns on desktop for 8 articles!) */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.1);
}

.post-cover {
  width: 100%;
  height: 195px;
  object-fit: cover;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  display: block;
}

.post-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.cat-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 9px;
  border-radius: 6px;
  font-weight: 600;
}

.post-title {
  font-size: 1.16rem;
  color: #0f172a;
  margin-bottom: 10px;
  line-height: 1.45;
}

.post-title a:hover {
  color: var(--primary);
}

.post-excerpt {
  color: #475569;
  font-size: 0.9rem;
  margin-bottom: 16px;
  flex: 1;
}

.read-more {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--primary);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.author-card {
  text-align: center;
}

.author-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: block;
  border: 3px solid #e0f2fe;
}

.author-name {
  font-size: 1.18rem;
  font-weight: 700;
  color: #0f172a;
}

.author-role {
  font-size: 0.86rem;
  color: var(--accent);
  font-weight: 600;
  margin: 4px 0 12px;
}

.author-bio {
  font-size: 0.89rem;
  color: var(--text-muted);
  text-align: left;
  line-height: 1.65;
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
}

.info-list {
  list-style: none;
  font-size: 0.89rem;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.recent-list a {
  font-size: 0.89rem;
  color: #334155;
  line-height: 1.45;
  display: block;
}

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

/* Single Article Page */
.article-wrap {
  max-width: 840px;
  margin: 36px auto 64px;
  padding: 0 24px;
}

.article-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 44px;
  box-shadow: var(--shadow);
}

.article-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: 1.85rem;
  color: #0f172a;
  line-height: 1.38;
  margin: 12px 0 14px;
}

.article-figure {
  margin: 26px 0;
  text-align: center;
}

.article-figure img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.article-figure figcaption {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.article-content h2 {
  font-size: 1.32rem;
  color: #0f172a;
  margin: 28px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

.article-content p {
  margin-bottom: 16px;
  font-size: 1.01rem;
  color: #334155;
}

.article-content ul, .article-content ol {
  margin: 0 0 18px 22px;
  color: #334155;
}

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

.callout {
  background: #f0f9ff;
  border-left: 4px solid #0284c7;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 22px 0;
  font-size: 0.94rem;
  color: #0c4a6e;
}

.code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 18px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 0.92rem;
}

.data-table th, .data-table td {
  border: 1px solid var(--border);
  padding: 11px 14px;
  text-align: left;
}

.data-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #0f172a;
}

.author-footer {
  margin-top: 36px;
  padding: 20px 24px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.author-footer img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.post-nav {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

/* Footer */
.footer {
  background: #0f172a;
  color: #94a3b8;
  text-align: center;
  padding: 32px 24px;
  font-size: 0.9rem;
}

.footer strong {
  color: #f8fafc;
}

@media (max-width: 920px) {
  .container { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .article-box { padding: 24px 18px; }
  .hero-text h1 { font-size: 1.7rem; }
}
