:root {
  color-scheme: light;
  --page: #f3f5f8;
  --card: #ffffff;
  --ink: #252b36;
  --muted: #7e8998;
  --text: #536173;
  --line: #dde3eb;
  --blue: #2f7df6;
  --blue-soft: #eaf3ff;
  --green: #3ca279;
  --yellow: #e1a737;
  --purple: #7a67d8;
  --coral: #dc665d;
  --teal: #239b9a;
  --shadow: 0 8px 22px rgba(31, 45, 61, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.75;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid #e3e8ef;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
}

.site-brand img {
  width: 44px;
  height: 44px;
  border: 2px solid #e6f3ff;
  border-radius: 50%;
  background: #eef7ff;
  object-fit: cover;
  object-position: center 28%;
  box-shadow: 0 6px 14px rgba(31, 45, 61, 0.12);
}

.brand-text {
  display: inline-grid;
  gap: 1px;
}

.site-brand strong {
  color: var(--blue);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand-text > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 56px;
}

.content-feed {
  display: grid;
  gap: 16px;
}

.section-head,
.topic-card,
.note-detail,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.section-head {
  padding: 24px 26px;
}

.section-head span,
.detail-title span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.section-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.section-head p {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 15px;
}

.topic-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  min-height: 168px;
  padding: 24px 26px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.topic-card:hover,
.topic-card:focus-visible {
  border-color: #b6cffc;
  box-shadow: 0 12px 28px rgba(47, 125, 246, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.featured-topic {
  min-height: 190px;
}

.topic-body {
  min-width: 0;
}

.topic-card h2,
.note-detail h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.38;
  letter-spacing: 0;
}

.topic-card p {
  margin: 16px 0 0;
  color: var(--text);
  font-size: 15px;
}

.topic-body::after {
  content: "查看生活记录";
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 18px;
  padding: 0 15px;
  border-radius: 18px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.topic-thumb {
  align-self: center;
  display: grid;
  place-items: center;
  gap: 6px;
  width: 86px;
  height: 86px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.blue-thumb {
  background: linear-gradient(145deg, #2f7df6, #62a9ff);
}

.green-thumb {
  background: linear-gradient(145deg, var(--green), #82cfae);
}

.yellow-thumb {
  background: linear-gradient(145deg, var(--yellow), #f4c86a);
}

.purple-thumb {
  background: linear-gradient(145deg, var(--purple), #ad9ff0);
}

.coral-thumb {
  background: linear-gradient(145deg, var(--coral), #ef9a91);
}

.teal-thumb {
  background: linear-gradient(145deg, var(--teal), #78cbc6);
}

.detail-list {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.note-detail {
  padding: 28px 30px;
}

.note-detail:target {
  border-color: #a9c9ff;
  box-shadow: 0 14px 32px rgba(47, 125, 246, 0.12);
}

.detail-title {
  margin-bottom: 14px;
}

.note-detail p {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 15px;
}

.knowledge-box {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid #d9e8ff;
  border-radius: 8px;
  background: #f7fbff;
}

.knowledge-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 15px;
}

.knowledge-box ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 15px;
}

.knowledge-box li + li {
  margin-top: 6px;
}

.sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
}

.side-panel {
  padding: 20px;
}

.side-panel h2 {
  position: relative;
  margin: 0 0 14px;
  padding-left: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.side-panel h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--blue);
}

.side-panel a {
  display: block;
  min-height: 42px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f4;
  color: #4e5b6b;
  font-size: 14px;
}

.side-panel a:last-child {
  border-bottom: 0;
}

.side-panel a:hover {
  color: var(--blue);
}

.study-panel p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: -28px auto 28px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer a:hover {
  color: var(--blue);
}

@media (max-width: 980px) {
  .topbar-inner {
    min-height: 68px;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  html {
    scroll-padding-top: 106px;
  }

  .topbar-inner,
  .page-shell,
  .site-footer {
    width: min(100% - 20px, 1180px);
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0;
  }

  .site-brand img {
    width: 40px;
    height: 40px;
  }

  .section-head,
  .topic-card,
  .note-detail,
  .side-panel {
    padding: 20px;
  }

  .topic-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .section-head h1 {
    font-size: 22px;
  }

  .topic-card h2,
  .note-detail h2 {
    font-size: 18px;
  }

  .topic-thumb {
    justify-self: start;
    width: 76px;
    height: 76px;
    font-size: 18px;
  }

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