:root {
  --bg: #0f0f11;
  --surface: #1a1a1e;
  --text: #e4e4e7;
  --muted: #8a8a93;
  --accent: #4ea1ff;
  --border: #2a2a30;
}

* { box-sizing: border-box; }

body {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

header { margin-bottom: 3rem; }
h1 { color: #fff; font-size: 2rem; margin: 0; }
.tagline { color: var(--muted); margin-top: 0.5rem; }

h2 { color: #fff; font-size: 1.3rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-top: 2.5rem; }
h3 { color: #fff; font-size: 1.1rem; margin-top: 2rem; }
h4 { color: #fff; font-size: 1rem; margin-top: 1.5rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.post-list { list-style: none; padding: 0; }
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem;
  margin: 0.75rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.post-list .date { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.post-list .lang {
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.5rem;
}

article h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
article .date { color: var(--muted); font-size: 0.9rem; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 2rem; padding: 0; list-style: none; }
.tags li {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

pre {
  background: #16161a !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}
pre code { padding: 0 !important; background: transparent !important; }
code { font-family: "SF Mono", Menlo, Consolas, monospace; }
p code, li code {
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

figure { margin: 1.75rem 0; text-align: center; }
figure img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fff;
}
figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 0.5rem; }

.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.75rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.formula {
  text-align: center;
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: 1.15rem;
  margin: 1.25rem 0;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.note {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 4px;
}

.back { display: inline-block; margin-bottom: 1.5rem; color: var(--muted); }

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}
.site-header .brand { color: #fff; font-weight: 600; font-size: 1.05rem; }
.site-header .brand:hover { text-decoration: none; color: var(--accent); }
.contact-btn {
  background: var(--accent);
  color: #0f0f11 !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
}
.contact-btn:hover { text-decoration: none; filter: brightness(1.1); }

.contact-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.contact-form label { display: grid; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.contact-form input, .contact-form textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form textarea { min-height: 180px; resize: vertical; }
.contact-form button {
  justify-self: start;
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: #0f0f11;
  border: 0;
  border-radius: 6px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
}
.contact-form button:hover { filter: brightness(1.1); }
.hp { position: absolute; left: -9999px; }

.grid-b { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.card-b {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem 1.4rem 1.3rem 1.6rem;
  transition: background .2s, transform .2s;
}
.card-b::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c, var(--accent));
}
.card-b:hover { background: #212126; text-decoration: none; transform: translateY(-2px); }
.card-b .meta { display: flex; justify-content: space-between; gap: 1rem; font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
.card-b .meta b { color: var(--c, var(--accent)); font-weight: 600; }
.card-b h3 { margin: 0 0 .5rem; font-size: 1.08rem; color: #fff; line-height: 1.35; }
.card-b p { margin: 0; font-size: .88rem; color: var(--muted); }
.card-b .more { display: inline-block; margin-top: .8rem; font-size: .82rem; color: var(--c, var(--accent)); font-weight: 600; }
