:root {
  --bg: #0a111a;
  --surface: #111a27;
  --surface-soft: #172234;
  --text: #e6edf7;
  --text-muted: #9aaecc;
  --line: rgba(152, 174, 204, 0.2);
  --brand: #7db5ff;
  --brand-soft: rgba(125, 181, 255, 0.14);
  --success: #4ad19a;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Source Sans 3", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, rgba(68, 116, 184, 0.28), transparent 30%),
    radial-gradient(circle at 88% 4%, rgba(44, 132, 108, 0.22), transparent 28%),
    linear-gradient(180deg, rgba(13, 22, 33, 0.98) 0%, rgba(10, 17, 26, 1) 40%),
    var(--bg);
  line-height: 1.65;
}

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

a:hover {
  color: var(--brand);
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(8, 12, 19, 0.76);
  border-bottom: 1px solid rgba(142, 168, 201, 0.16);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f5a96, #2f927f);
  box-shadow: 0 4px 16px rgba(40, 88, 146, 0.35);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.96rem;
  color: var(--text-muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.page {
  padding: 28px 0 56px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
}

.main-stack {
  display: grid;
  gap: 20px;
}

.card {
  background: rgba(17, 26, 39, 0.56);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 22px;
}

.hero {
  display: grid;
  gap: 16px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.25;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
}

.hero .subtitle {
  color: var(--text-muted);
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.86rem;
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 1px solid rgba(152, 174, 204, 0.28);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.16rem;
}

.section-head .meta {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.research-list,
.link-list,
.pub-list,
.post-list,
.note-list,
.topic-list,
.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.research-list li,
.pub-list li,
.post-list li,
.note-list li,
.topic-list li,
.timeline-list li {
  padding: 12px 0;
  border-bottom: 1px dashed rgba(152, 174, 204, 0.26);
}

.research-list li:last-child,
.pub-list li:last-child,
.post-list li:last-child,
.note-list li:last-child,
.topic-list li:last-child,
.timeline-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.research-title,
.pub-title,
.item-title {
  font-size: 1rem;
  font-weight: 600;
}

.pub-meta,
.item-meta,
.note-meta,
.topic-meta {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.inline-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.inline-links a {
  font-size: 0.88rem;
  color: var(--brand);
}

.sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
  position: sticky;
  top: 94px;
}

.profile {
  text-align: center;
}

.avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 12px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(141, 176, 221, 0.4);
}

.profile h3 {
  margin: 0;
  font-size: 1.05rem;
}

.profile p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.link-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(152, 174, 204, 0.26);
}

.link-list li:last-child {
  border-bottom: 0;
}

.link-list .label {
  color: var(--text-muted);
}

.view-toggle {
  display: inline-flex;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.view-toggle button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 7px 12px;
  cursor: pointer;
}

.view-toggle button.active {
  background: rgba(13, 20, 31, 0.88);
  color: var(--brand);
  box-shadow: none;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.timeline-group {
  border-left: 2px solid rgba(130, 168, 216, 0.52);
  padding-left: 14px;
  margin-bottom: 16px;
}

.timeline-group h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--brand);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.topic-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(18, 29, 44, 0.75);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.topic-card h3 {
  margin: 0;
  font-size: 1rem;
}

.topic-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.pinned-wrap {
  display: grid;
  gap: 14px;
}

.pinned-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(24, 36, 53, 0.95);
}

.cover {
  width: 100%;
  height: 188px;
  object-fit: cover;
  display: block;
}

.cover-body {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  color: #aad2ff;
  background: rgba(72, 132, 204, 0.15);
  border: 1px solid rgba(114, 167, 231, 0.4);
}

.note-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(17, 26, 39, 0.52);
  padding: 14px;
  display: grid;
  gap: 6px;
}

.note-item p {
  margin: 0;
}

.note-entry {
  scroll-margin-top: 96px;
}

.note-focus {
  outline: 2px solid rgba(132, 186, 255, 0.8);
  box-shadow: 0 0 0 6px rgba(74, 118, 170, 0.26);
  transition: box-shadow 0.25s ease;
}

.post-header {
  display: grid;
  gap: 8px;
}

.post-header h1 {
  margin: 0;
  line-height: 1.25;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.post-content {
  margin-top: 18px;
}

.post-content > *:first-child {
  margin-top: 0;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
}

.post-content p,
.post-content li {
  color: #d4dfef;
}

.post-content a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content code {
  padding: 2px 5px;
  background: rgba(90, 122, 168, 0.2);
  border-radius: 5px;
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: #111827;
  color: #e7ecf7;
  border-radius: 10px;
  padding: 14px;
  overflow: auto;
  font-size: 0.9rem;
}

.post-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.post-content blockquote {
  margin: 1em 0;
  padding: 8px 14px;
  border-left: 3px solid rgba(142, 176, 223, 0.85);
  background: rgba(74, 112, 168, 0.14);
  color: #c2d5ee;
}

.post-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 240px;
  gap: 34px;
}

.post-pane {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 16px;
}

.side-block {
  padding: 2px 0 14px;
  border-bottom: 1px solid rgba(152, 174, 204, 0.2);
}

.side-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.side-block h2 {
  margin: 0 0 10px;
  font-size: 0.96rem;
  color: #bfd1e8;
  letter-spacing: 0.02em;
}

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.side-list li {
  color: var(--text-muted);
  font-size: 0.89rem;
  line-height: 1.4;
}

.side-list li strong {
  color: var(--text);
}

.side-list li a {
  color: #c9d9ee;
}

.side-list li a:hover {
  color: var(--brand);
}

.side-list .active a {
  color: var(--brand);
  font-weight: 600;
}

.post-main {
  min-width: 0;
}

.post-main .post-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(152, 174, 204, 0.2);
}

.post-main .post-content {
  margin-top: 0;
}

.toc-nav {
  display: grid;
  gap: 6px;
}

.toc-item {
  font-size: 0.88rem;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  padding-left: 8px;
  line-height: 1.35;
}

.toc-item:hover {
  color: #d2e1f7;
}

.toc-item.active {
  color: var(--brand);
  border-left-color: var(--brand);
}

.toc-l2 {
  margin-left: 0;
}

.toc-l3 {
  margin-left: 10px;
}

.toc-l4,
.toc-l5,
.toc-l6 {
  margin-left: 18px;
}

.post-section-link {
  scroll-margin-top: 92px;
}

.side-link-index a {
  word-break: break-all;
}

.empty {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 12px;
  border: 1px dashed rgba(152, 174, 204, 0.34);
  border-radius: var(--radius-sm);
}

.site-footer {
  margin-top: 34px;
  border-top: 1px solid rgba(188, 203, 226, 0.2);
  padding-top: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.muted {
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  .two-column {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  .post-shell {
    width: min(1120px, calc(100% - 28px));
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .post-pane {
    position: static;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(1120px, calc(100% - 20px));
  }

  .header-inner {
    min-height: 64px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0;
  }

  .brand {
    font-size: 1rem;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  .card-pad {
    padding: 18px;
  }

  .cover {
    height: 164px;
  }
}
