:root {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --primary: #6366f1;
  --primary-light: #eef2ff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { opacity: 0.85; }
img { max-width: 100%; height: auto; }

/* ========== HEADER ========== */
.header {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
.logo-img { height: 32px; width: auto; display: block; }
  color: white; font-size: 16px; font-weight: 700;
}
.logo-text { font-weight: 700; font-size: 18px; color: var(--text); }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px;
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--primary-light); }

/* ========== HERO ========== */
.hero {
  background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%);
  padding: 64px 24px 48px;
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: 40px; font-weight: 700; line-height: 1.15; margin-bottom: 16px; }
.hero h1 span {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 18px; color: var(--text-secondary); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn-primary, .btn-outline {
  display: inline-block; padding: 10px 24px;
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 500;
  text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.btn-primary {
  background: var(--primary); color: white; border: none;
}
.btn-primary:hover { opacity: 0.9; color: white; }
.btn-outline {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Stats */
.stats { display: flex; justify-content: center; gap: 40px; margin-top: 32px; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ========== CATEGORY TAGS ========== */
.cat-nav {
  max-width: var(--max-width); margin: 0 auto;
  padding: 24px 24px 0; display: flex; gap: 8px; flex-wrap: wrap;
}
.cat-tag {
  padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); transition: all 0.2s; text-decoration: none;
}
.cat-tag:hover, .cat-tag.active {
  background: var(--primary-light); border-color: var(--primary); color: var(--primary);
}

/* ========== SECTIONS ========== */
.section { max-width: var(--max-width); margin: 0 auto; padding: 48px 24px; }
.section-header { margin-bottom: 24px; }
.section-header h2 { font-size: 24px; font-weight: 600; }

/* ========== ARTICLE LIST (HOMEPAGE & CATEGORY) ========== */
.article-list { display: flex; flex-direction: column; gap: 16px; }
.article-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; gap: 0;
  transition: all 0.2s;
}
.article-card:hover { box-shadow: var(--shadow-hover); border-color: var(--primary); }
.article-card-img {
  width: 260px; min-height: 160px; flex-shrink: 0; overflow: hidden;
}
.article-card-img img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s;
}
.article-card:hover .article-card-img img { transform: scale(1.05); }
.article-card-body { padding: 20px 24px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.article-card-meta { display: flex; gap: 12px; margin-bottom: 8px; }
.article-date, .article-cat { font-size: 13px; color: var(--text-muted); }
.article-card-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.article-card-title a { color: var(--text); text-decoration: none; }
.article-card-title a:hover { color: var(--primary); }
.article-card-excerpt { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.article-readmore { font-size: 13px; font-weight: 500; color: var(--primary); text-decoration: none; }

/* ========== POST (ARTICLE PAGE) ========== */
.post-container { max-width: 720px; margin: 0 auto; padding: 48px 24px; }
.post-header { margin-bottom: 32px; }
.post-meta { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; display: flex; gap: 8px; }
.post-title { font-size: 32px; font-weight: 700; line-height: 1.25; }
.post-content { font-size: 16px; line-height: 1.8; color: var(--text); }
.post-content h2 { font-size: 24px; margin: 32px 0 16px; }
.post-content h3 { font-size: 20px; margin: 24px 0 12px; }
.post-content p { margin-bottom: 16px; }
.post-content ul, .post-content ol { margin-bottom: 16px; padding-left: 24px; }
.post-content li { margin-bottom: 8px; }
.post-content img { border-radius: var(--radius-sm); margin: 24px 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.post-content th, .post-content td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.post-content th { background: var(--bg); font-weight: 600; }
.post-content blockquote {
  border-left: 3px solid var(--primary); padding: 12px 20px;
  margin: 24px 0; background: var(--primary-light); border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}
.post-tags { margin-top: 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.post-tags a {
  padding: 4px 12px; border-radius: 6px; font-size: 13px;
  background: var(--bg); color: var(--text-secondary); text-decoration: none;
  border: 1px solid var(--border);
}

/* Related */
.related-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-section h3 { font-size: 20px; margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.related-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text); transition: all 0.2s;
}
.related-item:hover { border-color: var(--primary); box-shadow: var(--shadow); color: var(--text); }
.related-title { font-size: 14px; font-weight: 500; }
.related-arrow { color: var(--primary); font-size: 16px; }

/* Amazon */
.amazon-section { margin-top: 32px; padding: 24px; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); }
.amazon-section h3 { font-size: 18px; margin-bottom: 8px; }
.amazon-note { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.amazon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.amazon-item {
  display: block; padding: 12px; background: #1e293b; color: white;
  border-radius: var(--radius-sm); text-decoration: none; font-weight: 500;
  text-align: center; font-size: 14px; transition: all 0.2s;
}
.amazon-item:hover { background: var(--primary); color: white; }

/* Post Nav */
.post-nav { display: flex; justify-content: space-between; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-nav a { font-size: 14px; color: var(--primary); text-decoration: none; }

/* ========== PAGINATION ========== */
.pagination { margin-top: 32px; display: flex; gap: 8px; justify-content: center; }
.pagination a, .pagination span {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; text-decoration: none; color: var(--text-secondary); background: var(--surface);
}
.pagination .current { background: var(--primary); color: white; border-color: var(--primary); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }

/* ========== FOOTER ========== */
.footer { background: #0f172a; color: #94a3b8; padding: 48px 24px 0; margin-top: 64px; }
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
}
.footer-col h4 { color: #f1f5f9; font-size: 16px; margin-bottom: 16px; }
.footer-col p { font-size: 14px; line-height: 1.6; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #94a3b8; text-decoration: none; font-size: 14px; }
.footer-col a:hover { color: white; }
.footer-bottom {
  max-width: var(--max-width); margin: 0 auto;
  padding: 24px 0; margin-top: 48px;
  border-top: 1px solid #1e293b; font-size: 13px; text-align: center;
}
.footer-bottom a { color: #94a3b8; }

/* ========== SEARCH FORM ========== */
.search-form { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.search-form input { flex: 1; border: none; padding: 10px 16px; font-size: 15px; outline: none; font-family: inherit; }
.search-form button {
  background: var(--primary); color: white; border: none;
  padding: 10px 20px; cursor: pointer; font-weight: 500;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  .stats { gap: 24px; }
  .article-card { flex-direction: column; }
  .article-card-img { width: 100%; height: 200px; }
  .post-title { font-size: 24px; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .nav-links a { font-size: 12px; padding: 4px 8px; }
  .header-inner { padding: 0 16px; }
}
@media (max-width: 480px) {
  .nav-links a:nth-child(n+4) { display: none; }
  .hero h1 { font-size: 24px; }
  .amazon-grid { grid-template-columns: 1fr 1fr; }
}
