:root {
  --bg: #101114;
  --bg-soft: rgba(20, 22, 27, 0.82);
  --panel: rgba(25, 28, 35, 0.84);
  --panel-strong: rgba(17, 19, 24, 0.92);
  --border: rgba(255, 255, 255, 0.1);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.64);
  --accent: #d66a4b;
  --accent-2: #f0bc78;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --radius: 24px;
  --radius-sm: 16px;
  --max: 1280px;
  --font-ui: "note", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-body: "note", "Noto Serif SC", "Source Han Serif SC", serif;
}

html[data-theme="light"] {
  --bg: #f5f1eb;
  --bg-soft: rgba(255, 252, 246, 0.88);
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --border: rgba(20, 20, 20, 0.08);
  --text: #1c1b19;
  --muted: rgba(28, 27, 25, 0.66);
  --accent: #9f4026;
  --accent-2: #d39443;
  --shadow: 0 20px 44px rgba(73, 48, 27, 0.14);
}

@font-face {
  font-family: "note";
  src: url("/blog/font/suc.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(10, 11, 15, 0.18), rgba(10, 11, 15, 0.48)),
    url("/blog/background/bac.webp") center top / cover fixed no-repeat;
  font-family: var(--font-body);
  min-height: 100vh;
}

html[data-theme="light"] body {
  background:
    linear-gradient(180deg, rgba(250, 245, 238, 0.12), rgba(240, 233, 224, 0.34)),
    url("/blog/background/bac.webp") center top / cover fixed no-repeat;
}

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

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 280px;
  gap: 24px;
}

.sidebar,
.panel,
.post-card,
.toc-panel,
.timeline-item,
.link-card,
.category-card,
.search-result,
.article-shell,
.empty-state {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sidebar {
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 20px;
  height: fit-content;
}

.sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.avatar {
  width: 124px;
  height: 164px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-title {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.1;
  font-weight: 700;
  font-family: var(--font-body);
}

.site-subtitle,
.muted {
  color: var(--muted);
}

.site-subtitle {
  margin: 12px 0 0;
  line-height: 1.7;
  font-size: 0.96rem;
}

.social-row,
.nav-list,
.toc-list,
.quick-list,
.meta-row,
.tag-row {
  list-style: none;
  padding: 0;
  margin: 0;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 18px;
}

.social-link,
.theme-toggle,
.nav-link,
.chip,
.action-link,
.search-tag {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.social-link,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--muted);
}

.social-link svg,
.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-link svg.is-fill,
.theme-toggle svg.is-fill {
  fill: currentColor;
  stroke: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.social-link:hover,
.theme-toggle:hover,
.nav-link:hover,
.chip:hover,
.action-link:hover,
.search-tag:hover {
  color: var(--text);
  border-color: rgba(214, 106, 75, 0.5);
  background: rgba(214, 106, 75, 0.14);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  color: var(--muted);
  transition: 0.2s ease;
}

.nav-link.is-active {
  color: var(--text);
  background: rgba(214, 106, 75, 0.16);
  border-color: rgba(214, 106, 75, 0.4);
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  border-radius: var(--radius);
  padding: 28px;
}

.hero-panel {
  padding: 34px 32px;
  background:
    radial-gradient(circle at top right, rgba(240, 188, 120, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(214, 106, 75, 0.16), rgba(13, 14, 18, 0.18)),
    var(--panel-strong);
}

.eyebrow {
  color: var(--accent-2);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 14px;
}

.hero-title,
.section-title,
.article-title {
  margin: 0;
  line-height: 1.1;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.hero-copy {
  margin: 14px 0 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.02rem;
}

.hero-actions,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 22px;
}

.action-link,
.chip,
.search-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--muted);
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  font-size: 1.7rem;
}

.grid {
  display: grid;
  gap: 18px;
}

.posts-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-card,
.category-card,
.link-card,
.search-result,
.timeline-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.post-cover {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
}

.card-body,
.timeline-item,
.search-result,
.link-card,
.category-card {
  padding: 18px 18px 20px;
}

.post-card .card-body {
  padding: 18px;
}

.card-title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.35;
}

.card-desc,
.search-result p,
.timeline-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.meta-row,
.tag-row {
  margin-top: 14px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.chip {
  padding: 6px 12px;
  font-size: 0.84rem;
}

.toc-panel h3,
.mini-title {
  margin: 0 0 14px;
  font-size: 1rem;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-list a,
.quick-list a {
  color: var(--muted);
  line-height: 1.55;
}

.toc-list a:hover,
.quick-list a:hover {
  color: var(--text);
}

.quick-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-shell {
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
}

.article-header {
  display: flex;
  flex-direction: column;
}

.article-hero-image {
  width: 100%;
  max-height: 52vh;
  object-fit: cover;
}

.article-meta {
  padding: 26px 30px 8px;
}

.article-title {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
}

.article-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 1rem;
}

.article-content {
  padding: 8px 30px 30px;
  font-family: var(--font-body);
  line-height: 1.88;
  font-size: 1.06rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin: 2.1em 0 0.9em;
  line-height: 1.25;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content figure,
.article-content pre,
.article-content .highlight,
.article-content .table-wrapper,
.article-content .gallery,
.article-content .video-wrapper {
  margin: 1.4em 0;
}

.article-content a {
  color: var(--accent-2);
}

.article-content blockquote {
  padding: 2px 18px;
  border-left: 3px solid rgba(240, 188, 120, 0.7);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 14px 14px 0;
}

.article-content code {
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px 6px;
}

.article-content pre,
.article-content .highlight {
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(7, 8, 11, 0.7);
  border: 1px solid var(--border);
}

.article-content pre code,
.article-content .highlight code {
  background: transparent;
  padding: 0;
}

.article-content .highlight table {
  width: 100%;
  border-collapse: collapse;
}

.article-content .highlight td {
  vertical-align: top;
}

.article-content .highlight .lntd:first-child {
  width: 44px;
  color: rgba(255, 255, 255, 0.38);
  user-select: none;
}

.article-content figure,
.article-content .gallery {
  text-align: center;
}

.article-content img {
  border-radius: 16px;
  margin: 0 auto;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
}

.timeline-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-year {
  margin: 10px 0 0;
  color: var(--accent-2);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.search-box {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
}

.search-box::placeholder {
  color: var(--muted);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.empty-state {
  border-radius: var(--radius-sm);
  padding: 22px;
  color: var(--muted);
}

.footer-note {
  display: none;
}

@media (max-width: 1180px) {
  .page-shell {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .sidebar-right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .page-shell {
    grid-template-columns: 1fr;
    width: min(calc(100% - 24px), var(--max));
  }

  .sidebar {
    position: static;
  }

  .posts-grid,
  .sidebar-right {
    grid-template-columns: 1fr;
  }

  .panel,
  .sidebar {
    padding: 22px;
  }

  .hero-panel {
    padding: 28px 22px;
  }

  .article-meta,
  .article-content {
    padding-left: 22px;
    padding-right: 22px;
  }
}
