:root {
  --bg: #faf9f7;
  --card-bg: #fff;
  --text: #2c2c2c;
  --text-light: #666;
  --link: #1a73e8;
  --link-hover: #1557b0;
  --border: #e8e6e3;
  --code-bg: #f4f3f1;
  --tag-bg: #e8f0fe;
  --muted: #999;
  --max-w: 740px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  background: rgba(250,249,247,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky; top: 0; z-index: 100;
}

nav {
  max-width: var(--max-w); margin: 0 auto; padding: 0 1rem;
  display: flex; justify-content: space-between; align-items: center;
  height: 56px;
}

.logo {
  font-size: 1.15rem; font-weight: 700; color: var(--text);
  text-decoration: none; letter-spacing: -.3px;
}

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--text-light); text-decoration: none; font-size: .9rem;
  transition: color .15s;
}
.nav-links a:hover { color: var(--link); }

/* Main layout */
main {
  max-width: var(--max-w); margin: 0 auto; padding: 2rem 1rem 3rem;
}

/* Hero */
.hero {
  position: relative;
  text-align: center;
  padding: 4rem 0 3.5rem;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  background-image: url('/images/banner_hero.jpg');
  background-size: cover;
  background-position: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.hero h1 {
  position: relative;
  z-index: 1;
  font-size: 2.4rem; font-weight: 800; letter-spacing: -.5px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.subtitle {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,.85);
  font-size: 1.1rem; margin-top: .6rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.2);
}

/* Post list */
.post-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow .2s, transform .2s;
}
.post-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.post-item h2 { font-size: 1.25rem; margin-bottom: .4rem; line-height: 1.4; }
.post-item h2 a {
  color: var(--text); text-decoration: none;
  transition: color .15s;
}
.post-item h2 a:hover { color: var(--link); }

.post-meta {
  font-size: .85rem; color: var(--muted); margin-bottom: .6rem;
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
}

.tags { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.tag {
  display: inline-block; background: var(--tag-bg); color: var(--link);
  padding: .15rem .5rem; border-radius: 20px; font-size: .78rem;
  font-weight: 500;
}

.summary { color: var(--text-light); font-size: .93rem; margin-bottom: .6rem; line-height: 1.6; }

.read-more {
  color: var(--link); text-decoration: none; font-size: .88rem;
  font-weight: 500; transition: color .15s;
}
.read-more:hover { color: var(--link-hover); }

/* Single post */
.post-header { margin-bottom: 2rem; }
.post-header h1 {
  font-size: 2rem; font-weight: 800; letter-spacing: -.4px;
  line-height: 1.3; margin-bottom: .6rem;
}

.post-content h2 {
  font-size: 1.5rem; font-weight: 700; margin: 2.2rem 0 .8rem;
  letter-spacing: -.3px; padding-bottom: .4rem;
  border-bottom: 2px solid var(--border);
}
.post-content h3 { font-size: 1.2rem; font-weight: 600; margin: 1.8rem 0 .6rem; }
.post-content h4 { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 .5rem; }

.post-content p { margin-bottom: 1rem; line-height: 1.8; }
.post-content ul, .post-content ol { margin: 0 0 1rem 1.5rem; }
.post-content li { margin-bottom: .3rem; }

.post-content blockquote {
  border-left: 4px solid var(--link);
  padding: .8rem 1.2rem;
  margin: 1.2rem 0;
  background: var(--card-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-light);
}

.post-content code {
  background: var(--code-bg);
  padding: .15rem .35rem;
  border-radius: 4px;
  font-size: .88em;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", "Consolas", monospace;
}

.post-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.2rem;
  font-size: .88rem;
  line-height: 1.5;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.2rem;
  font-size: .9rem;
}
.post-content th, .post-content td {
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  text-align: left;
}
.post-content th {
  background: var(--code-bg);
  font-weight: 600;
}
.post-content tr:nth-child(even) {
  background: rgba(0,0,0,.015);
}

.post-content img { max-width: 100%; border-radius: var(--radius); margin: 1rem 0; }
.post-content a { color: var(--link); word-break: break-word; }
.post-content a:hover { color: var(--link-hover); }

.post-content hr {
  border: none; border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.post-nav a {
  color: var(--link);
  text-decoration: none;
  font-size: .9rem;
  max-width: 45%;
  transition: color .15s;
}
.post-nav a:hover { color: var(--link-hover); }
.post-nav .next { text-align: right; }

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: .83rem;
  border-top: 1px solid var(--border);
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text-light); }

/* Responsive */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.7rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero::before { background: rgba(0,0,0,.5); }
  .post-header h1 { font-size: 1.5rem; }
  .post-item { padding: 1.2rem; }
  .post-meta { font-size: .8rem; }
}
