:root {
  --bg: #f7f9ff;
  --card: #ffffff;
  --primary: #7a8df5;
  --primary-strong: #6f81ea;
  --primary-soft: #eef1ff;
  --text: #2b3142;
  --muted: #7d8597;
  --border: #e9ecf7;
  --shadow: 0 10px 28px rgba(123, 141, 245, 0.12);
  --shadow-hover: 0 16px 34px rgba(123, 141, 245, 0.18);
  --font-sans-fallback: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-sans: var(--font-sans-fallback);
}

html.fonts-loaded {
  --font-sans: "Source Han Sans SC", var(--font-sans-fallback);
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Han Sans SC";
  src: url("../fonts/SourceHanSansSC-Normal.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

.meta-page {
  background: var(--bg);
}

.news-page .container {
  width: min(2400px, 99.7vw);
  padding-left: 6px;
  padding-right: 6px;
}

.news-sites {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-site-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px;
  box-shadow: 0 4px 14px rgba(122, 141, 245, 0.08);
}

.news-site-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.news-site-title-wrap {
  min-width: 0;
}

.news-site-title-link {
  color: #2d3a64;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.news-site-title-link:hover {
  color: #5064da;
}

.news-more-link {
  color: #5267df;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.8rem;
}

.news-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.news-item {
  border: 1px solid #eef1ff;
  border-radius: 8px;
  padding: 7px 8px;
  background: #fbfcff;
}

.news-item-top {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-bottom: 3px;
}

.news-rank {
  font-size: 0.74rem;
  color: #8893b1;
  min-width: 22px;
}

.news-title {
  color: #2a3558;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.news-title:hover {
  color: #4f63d8;
}

.news-meta-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 0.72rem;
  color: #7c86a3;
}

.news-meta-date {
  white-space: nowrap;
}

.news-meta-sep {
  color: #a0aac8;
}

.news-meta-tags {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-meta-tag-link {
  color: #5e6fc7;
  text-decoration: none;
}

.news-meta-tag-link:hover {
  color: #4056cf;
  text-decoration: underline;
}

.news-meta-tag-dot {
  color: #9aa5c6;
}

.news-meta-line i {
  margin-right: 3px;
}

@media (max-width: 1500px) {
  .news-sites {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .news-page .container {
    width: min(1800px, 99vw);
    padding-left: 4px;
    padding-right: 4px;
  }

  .news-sites {
    grid-template-columns: 1fr;
  }

  .news-list {
    grid-template-columns: 1fr;
  }
}

.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.news-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #dfe5ff;
  color: #4d63d8;
  font-size: 0.8rem;
  text-decoration: none;
  background: #f5f7ff;
}

.news-tag-empty {
  color: #8a93ac;
  border-color: #e8ecf8;
  background: #fafbff;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #7c86a3;
  font-size: 0.84rem;
}

.news-meta i {
  margin-right: 4px;
}

.not-found-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(186, 230, 253, 0.32), transparent 34%),
    radial-gradient(circle at 86% 82%, rgba(221, 214, 254, 0.3), transparent 36%),
    linear-gradient(130deg, #f8fbff 0%, #f5f7ff 48%, #f9fbff 100%);
}

.container {
  width: min(1440px, 95%);
  margin: 0 auto;
}

.hero {
  background:
    radial-gradient(circle at 12% 20%, rgba(162, 210, 255, 0.38), transparent 34%),
    radial-gradient(circle at 88% 80%, rgba(221, 214, 254, 0.4), transparent 36%),
    linear-gradient(120deg, #f7f9ff 0%, #eef2ff 50%, #f6f8ff 100%);
  color: var(--text);
  padding: 60px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(122, 141, 245, 0.12);
  transition: padding 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-content {
  max-width: 520px;
}

.hero-title {
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  margin: 0 0 8px 0;
  font-weight: 600;
  transition: transform 0.35s ease, font-size 0.35s ease;
}

.hero-title-home-link {
  color: inherit;
  text-decoration: none;
}

.hero-title-home-link:hover,
.hero-title-home-link:focus,
.hero-title-home-link:active,
.hero-title-home-link:visited {
  color: inherit;
  text-decoration: none;
}

.hero-subtitle {
  min-height: 1.4em;
  font-size: 0.95rem;
  opacity: 0.92;
  color: #667089;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.hero.shrink,
.hero-fixed {
  padding: 14px 0;
  box-shadow: 0 10px 24px rgba(122, 141, 245, 0.2);
  backdrop-filter: blur(10px);
}

.hero.shrink .hero-title,
.hero-fixed .hero-title {
  font-size: 1.35rem;
  transform: translateY(-2px);
}

.hero-fixed .hero-subtitle {
  display: none;
}

.badge {
  background: rgba(255, 255, 255, 0.2);
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.subtitle {
  max-width: 560px;
  font-size: 1.05rem;
  opacity: 0.9;
}

.top-nav {
  display: flex;
  align-items: center;
}

.top-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-nav .nav-item-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.top-nav .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.96rem;
  color: #465069;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.top-nav .nav-item.is-text {
  cursor: default;
}

.top-nav .nav-item.is-text.nav-home-link {
  cursor: pointer;
}

.top-nav .nav-item:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: #dce3ff;
  color: var(--primary-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(122, 141, 245, 0.18);
}

.top-nav .nav-item.is-text:hover {
  transform: none;
  box-shadow: none;
}

.top-nav .nav-item.is-text.nav-home-link:hover {
  background: transparent;
  border-color: transparent;
  color: #465069;
}

.top-nav .nav-item-group:focus-within .nav-children,
.top-nav .nav-item-group:hover .nav-children {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.top-nav .nav-children {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 160px;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 6px;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.top-nav .nav-children::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.top-nav .nav-children.align-right {
  left: auto;
  right: 0;
}

.top-nav .nav-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1f2937;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.top-nav .nav-child:hover {
  background: #f3f4f6;
  color: #1d4ed8;
}

.top-nav .nav-child.is-text {
  color: #6b7280;
  cursor: default;
}

.top-nav .nav-child.is-text:hover {
  background: transparent;
  color: #6b7280;
}

.top-nav .icon {
  font-size: 1.1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 2px;
  position: relative;
  z-index: 20;
  isolation: isolate;
  overflow: visible;
}

.search-box {
  flex: 1;
  min-width: 240px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-box input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid #e3e8fb;
  background: #fff;
  box-shadow: 0 10px 24px rgba(122, 141, 245, 0.1);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
  border-color: #c8d1fb;
  box-shadow: 0 0 0 4px rgba(122, 141, 245, 0.12);
}

.icon-button {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.1rem;
  cursor: pointer;
}

.icon-button:hover {
  color: #6b7280;
}

.icon-button.hidden {
  display: none;
}

#search-button {
  border: 1px solid #dbe2ff;
  background: linear-gradient(135deg, #eef1ff, #f8f9ff);
  color: #4a56a8;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

#search-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(122, 141, 245, 0.16);
  border-color: #cfd8ff;
}

.category-filters {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 8px;
  align-items: end;
  margin-top: 2px;
  margin-bottom: 0;
  padding: 0 0 6px;
  position: relative;
  overflow: visible;
  z-index: 25;
}

.category-filters-list {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-height: 72px;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-right: 42px;
  box-sizing: border-box;
  width: 100%;
}

.category-filters-list.is-expanded {
  max-height: 600px;
  padding-right: 0;
}

.category-expand-btn {
  appearance: none;
  -webkit-appearance: none;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 0 2px;
  padding: 0;
  border: 1px dashed #c8d1f0;
  border-radius: 999px;
  background: #fff;
  color: #6b7ba8;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  position: relative;
  z-index: 30;
}

.category-filters-list.is-expanded + .category-expand-btn {
  margin-left: auto;
}

.category-expand-btn:hover {
  background: #f4f7ff;
  border-color: #a8b6e2;
  color: #3d52a0;
  transform: translateY(-1px);
}

.category-expand-btn i {
  font-size: 0.75rem;
}

.category-filters-empty {
  display: inline-flex;
  align-items: center;
  color: #8a93ac;
  font-size: 0.88rem;
  padding: 6px 2px;
}

.category-filter-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #e4e8f5;
  background: #ffffff;
  color: #4b556f;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.category-filter-chip:hover {
  border-color: #cfd7ee;
  color: #2f3a55;
  background: #f9fbff;
  box-shadow: 0 2px 10px rgba(80, 96, 140, 0.08);
}

.category-filter-chip.is-active {
  border-color: #8fa3d9;
  background: #f4f7ff;
  color: #273a74;
  box-shadow: 0 0 0 2px rgba(143, 163, 217, 0.16);
}

.category-filter-count {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f5fa;
  border: 1px solid #e5e9f4;
  color: #6b748e;
  font-size: 0.7rem;
  font-weight: 600;
}

.category-filter-chip.is-active .category-filter-count {
  background: #e6edff;
  border-color: #cfdcff;
  color: #324f9b;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-filter button {
  background: #fff;
  color: var(--muted);
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-filter button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.meta-row a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.meta-row a:hover {
  color: var(--primary);
  text-decoration: none;
}

.meta-header {
  margin: 24px 0 14px;
}

.meta-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

.meta-header-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid #e7ebff;
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: 0 10px 24px rgba(76, 93, 201, 0.09);
}

.teaching-page .meta-header-inner {
  justify-content: flex-end;
}

.route-header-inner {
  justify-content: space-between;
  max-width: 980px;
  padding: 0;
}

.route-description {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: right;
}

.route-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.route-year {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 20px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.route-year-header {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 600;
}

.route-year-icon {
  font-size: 20px;
}

.route-entries {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.route-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  line-height: 1.35;
}

.route-entry-title {
  color: #1a1a1a;
  text-decoration: none;
}

.route-entry-title:hover {
  text-decoration: underline;
}

.route-entry-date {
  color: var(--muted);
  font-size: 15px;
}

.header-icon {
  font-size: 22px;
}

.header-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2a44;
}

.header-count {
  display: inline-block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: #4f5f86;
  padding: 0;
  margin-left: 2px;
  font-variant-numeric: tabular-nums lining-nums;
  transform: translateY(-7px);
}

.meta-index {
  margin: 4px auto 48px;
  max-width: 1180px;
  padding: 0 22px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.category-section {
  margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid #e8ecff;
  border-radius: 16px;
  padding: 14px 16px 12px;
  box-shadow: 0 12px 22px rgba(31, 45, 94, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.category-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(31, 45, 94, 0.12);
  border-color: #dce4ff;
}

.category-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.folder-icon {
  font-size: 18px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef2ff;
}

.category-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.category-title:hover {
  color: #3159d8;
}

.category-count {
  font-size: 14px;
  color: #687089;
  margin-left: auto;
  align-self: center;
}

.note-list {
  list-style: none;
  margin-bottom: 8px;
  display: grid;
  gap: 4px;
}

.note-item {
  font-size: 15px;
  line-height: 1.35;
  color: #3b445a;
}

.note-item a {
  color: inherit;
  text-decoration: none;
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.note-item a:hover {
  background: #f3f6ff;
  color: #1d4ed8;
}

.more-link {
  font-size: 14px;
  font-weight: 600;
  color: #4f5f86;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
  margin-left: auto;
  border-radius: 10px;
  padding: 5px 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.more-link:hover {
  background: #eef2ff;
  color: #2446bd;
}

.meta-posts {
  display: grid;
  gap: 10px;
}

.meta-post {
  padding: 4px 0;
}

.meta-post h4 {
  margin-bottom: 6px;
}

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

.meta-post a {
  color: #333333;
  text-decoration: none;
}

.meta-post a:hover {
  text-decoration: underline;
}

.meta-more {
  margin-top: 18px;
  text-align: right;
}

.meta-more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #333333;
  text-decoration: none;
  font-size: 20px;
}

.meta-more-link:hover {
  text-decoration: underline;
}

.meta-more-list {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.search-container {
  margin: 40px 0 80px;
}

.search-toolbar {
  margin-bottom: 24px;
}

.search-results {
  display: grid;
  gap: 16px;
}

.search-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px rgba(18, 38, 63, 0.12);
}

.search-card p {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.7;
}

.highlight,
.search-highlight {
  color: #dc2626;
  font-weight: 700;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 4px 0 40px;
  position: relative;
  z-index: 1;
}

.card {
  background: #fff;
  border-radius: 14px;
  padding: 22px 22px 18px;
  min-height: 200px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  cursor: pointer;
  position: relative;
  overflow: visible;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
}

.card::after {
  content: none;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  border-color: #cbd5e1;
  background-color: #f1f5f9;
}

.card:hover::after {
  opacity: 0;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .card-title {
  font-size: 1.15rem;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .card-summary-wrap {
  position: relative;
  flex: 1 1 auto;
}

.card .card-summary {
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.card .card-summary-wrap.has-tooltip {
  cursor: default;
}

.card .card-summary-wrap .card-summary-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  min-width: min(420px, 58vw);
  max-width: min(620px, 78vw);
  max-height: min(52vh, 360px);
  overflow: auto;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #dbe3f1;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  font-size: 0.86rem;
  line-height: 1.66;
  white-space: pre-wrap;
  word-break: break-word;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  z-index: 120;
  pointer-events: none;
}

.card .card-summary-wrap.has-tooltip .card-summary-pop::before {
  content: "";
  position: absolute;
  left: 18px;
  top: -7px;
  width: 12px;
  height: 12px;
  border-left: 1px solid #dbe3f1;
  border-top: 1px solid #dbe3f1;
  background: #ffffff;
  transform: rotate(45deg);
}

.card .card-summary-wrap.has-tooltip:hover .card-summary-pop,
.card .card-summary-wrap.has-tooltip:focus-within .card-summary-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.card .card-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
  flex-shrink: 0;
  overflow: visible;
}

.card .meta-date {
  white-space: nowrap;
  flex-shrink: 0;
}

.card .meta-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow: visible;
  margin-top: 10px;
}

.card .meta-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-width: 0;
  max-width: min(220px, 45%);
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.5;
}

.card .meta-item i {
  color: #64748b;
  flex-shrink: 0;
}

.card .meta-item-inline {
  max-width: min(200px, 50%);
}

.card .meta-link.meta-chip,
.card .meta-chip.has-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

.card .meta-link.meta-chip:hover,
.card .meta-chip.has-tooltip:hover {
  color: #0f172a;
}

.card .meta-chip-text {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.card .meta-chip-text.has-tooltip:hover + .meta-chip-pop,
.card .meta-chip-text.has-tooltip:focus-visible + .meta-chip-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.card .meta-link.meta-chip .meta-chip-text.has-tooltip {
  cursor: default;
}

.card .meta-link.meta-chip .meta-chip-text.has-tooltip:hover {
  color: #0f172a;
}

.card .meta-chip-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  max-width: 320px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #dbe3f1;
  background: #ffffff;
  color: #334155;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.card .tag-group {
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
}

.card .tag-chips {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.card .tag-chips-pop {
  left: 0;
  top: calc(100% + 8px);
}

.card .tag-chips.has-tooltip:hover .tag-chips-pop,
.card .tag-chips.has-tooltip:focus-within .tag-chips-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.card .tag-chips.has-tooltip:hover:has(.tag-chip:hover) .tag-chips-pop,
.card .tag-chips.has-tooltip:focus-within:has(.tag-chip:focus-visible) .tag-chips-pop {
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
}

.card .meta-link.meta-chip:hover .meta-chip-pop,
.card .meta-link.meta-chip:focus-visible .meta-chip-pop,
.card .meta-chip.has-tooltip:hover .meta-chip-pop,
.card .meta-chip.has-tooltip:focus-visible .meta-chip-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.card .meta-chip.meta-ellipsis {
  padding: 0 4px;
  border-radius: 6px;
}

.post-page .hero.slim {
  padding: 32px 0 40px;
}

.reading-progress-bar {
  --fi-progress: 0%;
  --fi-progress-degree: 0deg;
  position: fixed;
  top: 0;
  left: 0;
  width: var(--fi-progress);
  height: 3px;
  z-index: 2100;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-strong) 55%, #22c55e 100%);
  box-shadow: 0 0 12px rgba(122, 141, 245, 0.42);
  transition: width 0.14s linear;
  will-change: width;
}

.reading-progress-float {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 2090;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, #ffffff 76%);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(122, 141, 245, 0.2), rgba(111, 129, 234, 0.16)),
    #ffffff;
  color: #2f3f78;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(61, 79, 166, 0.2);
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.reading-progress-float:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(61, 79, 166, 0.26);
  background:
    linear-gradient(135deg, rgba(122, 141, 245, 0.3), rgba(111, 129, 234, 0.2)),
    #ffffff;
}

.reading-progress-float i {
  font-size: 0.8rem;
  color: var(--primary-strong);
}

.reading-progress-value {
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2f6fed;
  background: #eef2ff;
  border: 1px solid #dfe6ff;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 14px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
  background: #e5ecff;
  color: #234fc4;
  border-color: #cfdcff;
  transform: translateY(-1px);
}

.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e17d1a;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 14px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  margin-left: 12px;
}

.rss-link:hover {
  background: #ffedd5;
  color: #c25a0a;
  border-color: #fdba74;
  transform: translateY(-1px);
}

.post-layout {
  display: grid;
  grid-template-columns: 240px 1fr 260px;
  gap: 32px;
  margin: 40px 0 80px;
}

.post-layout.without-toc {
  grid-template-columns: 240px 1fr 260px;
}

.post-layout.locked {
  grid-template-columns: 1fr;
  justify-items: center;
}

.post-layout.locked .toc,
.post-layout.locked .collection-panel,
.post-layout.locked .post-main {
  display: none;
}

.post-lock-screen {
  grid-column: 1;
  width: min(560px, 100%);
  margin: 22px auto;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  text-align: left;
  padding: 30px;
  border-radius: 16px;
  border: 1px solid #e7ebf3;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 30, 52, 0.08);
}

.post-lock-title {
  font-size: 1.48rem;
  color: #22304d;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.post-lock-desc {
  font-size: 0.95rem;
  color: #657089;
  margin-bottom: 18px;
  line-height: 1.65;
}

.post-lock-input-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-lock-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 1px solid #d7dde8;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 0.94rem;
  color: #1f2937;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.post-lock-input:focus {
  border-color: #9fb2da;
  box-shadow: 0 0 0 3px rgba(112, 141, 201, 0.14);
}

.post-lock-btn {
  height: 42px;
  border: 1px solid #d2dbe9;
  border-radius: 10px;
  background: #f7f9fc;
  color: #2f3f62;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.post-lock-btn:hover {
  background: #f1f4f9;
  border-color: #bec9dc;
}

.post-lock-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.post-lock-feedback {
  margin-top: 10px;
  min-height: 22px;
  color: #c24141;
  font-size: 0.88rem;
}

.post-layout.without-toc .post-main {
  grid-column: 2;
}

.post-layout.without-toc .collection-panel {
  grid-column: 3;
}

.post-layout > * {
  min-width: 0;
}

.post-main {
  grid-column: 2;
  background: var(--card);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid #eee;
  background-image: linear-gradient(#f5f5f5 1px, transparent 1px);
  background-size: 20px 20px;
  min-width: 0;
}

.post-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.post-title {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 700;
  margin: 0;
}

.post-summary {
  position: relative;
  margin-top: 6px;
  padding: 14px 16px 14px 44px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
  color: #334155;
  font-size: 1rem;
  line-height: 1.8;
  box-shadow: 0 10px 22px rgba(59, 130, 246, 0.08);
}

.post-summary::before {
  content: "摘";
  font-weight: 700;
  position: absolute;
  left: 14px;
  top: 14px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.72rem;
}

.post-summary::after {
  content: "摘要";
  position: absolute;
  top: -10px;
  right: 14px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.post-summary:empty {
  display: none;
}

.post-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.post-meta .meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #6b7280;
  font-size: 0.9rem;
}

.post-meta .author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.post-meta .author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.post-meta .meta-link {
  color: #2385bb;
  text-decoration: none;
  font-weight: 600;
}

.post-meta .meta-link:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.meta-divider {
  color: #cbd5f5;
}

.post-content {
  padding: 0;
  box-shadow: none;
  background: transparent;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin: 18px 0 12px;
  font-weight: 600;
}

.toc {
  position: sticky;
  top: 88px;
  align-self: start;
  background: var(--card);
  border-radius: 12px;
  padding: 16px 14px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 120px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #e7ebff;
}

.collection-panel {
  position: sticky;
  top: 88px;
  align-self: start;
  background: var(--card);
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
  display: none;
}

.collection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 1rem;
  color: #111827;
}

.collection-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.collection-title::before {
  content: "合集";
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
  margin-right: 4px;
}

.collection-count {
  font-size: 0.95rem;
  color: #6b7280;
}

.collection-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.collection-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #374151;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
  font-size: 0.92rem;
}

.collection-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.collection-item.is-active {
  font-weight: 600;
  color: #2563eb;
}

.collection-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c7d2fe;
  flex-shrink: 0;
}

.collection-item.is-active .collection-indicator {
  background: #f43f5e;
}

.collection-text {
  flex: 1;
  line-height: 1.4;
}

.related-posts {
  margin-top: 28px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
}

.related-posts-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #111827;
}

.related-posts-header p {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.related-posts-list {
  margin-top: 14px;
}

.related-posts-base-grid,
.related-posts-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.related-posts-extra {
  margin-top: 10px;
}

.related-post-item {
  display: block;
  padding: 12px;
  border: 1px solid #eef2ff;
  border-radius: 10px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.related-post-item:hover {
  transform: translateY(-1px);
  border-color: #c7d2fe;
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.08);
}

.related-post-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

.related-post-title a {
  color: #1f2937;
  text-decoration: none;
}

.related-post-title a:hover {
  color: #1d4ed8;
}

.related-post-meta-line {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  color: #6b7280;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
}

.related-post-meta-line > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.related-post-tags-inline {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.related-post-tags-inline .meta-link.tag {
  text-decoration: none;
}

.related-post-no-tag {
  color: #9ca3af;
}

.related-posts-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.related-posts-more {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.related-posts-more:hover {
  background: #dbeafe;
}

@media (max-width: 900px) {
  .related-posts-base-grid,
  .related-posts-extra-grid {
    grid-template-columns: 1fr;
  }

  .related-post-meta-line {
    flex-wrap: wrap;
    white-space: normal;
  }
}

.toc-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #111827;
}

.toc-title-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toc-title svg {
  width: 16px;
  height: 16px;
}

.toc-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toc-action-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #dbe4ff;
  background: #f8faff;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toc-action-btn:hover {
  color: #3b82f6;
  border-color: #bfd0ff;
  background: #eef4ff;
}

.toc-list {
  position: relative;
  font-size: 0.92rem;
}

.toc-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.toc-tree .toc-tree {
  margin-left: 12px;
  padding-left: 10px;
  border-left: 1px dashed #e3e8f6;
}

.toc-item {
  margin: 2px 0;
}

.toc-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
}

.toc-toggle {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.toc-toggle i {
  font-size: 0.72rem;
  transition: transform 0.2s ease;
}

.toc-item.is-expanded > .toc-row > .toc-toggle i {
  transform: rotate(90deg);
}

.toc-toggle:hover {
  color: #3b82f6;
  background: #eef4ff;
}

.toc-item.is-leaf .toc-row {
  padding-left: 22px;
}

.toc-link {
  display: block;
  position: relative;
  flex: 1;
  min-width: 0;
  color: #4b5563;
  text-decoration: none;
  margin: 1px 0;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.toc-link:hover {
  color: #2563eb;
  background: rgba(59, 130, 246, 0.08);
  transform: translateX(1px);
}

.toc-link.active {
  color: #1d4ed8;
  border-left-color: #3b82f6;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.16), rgba(59, 130, 246, 0.02));
  font-weight: 700;
}

.toc-link.ancestor {
  color: #2563eb;
  font-weight: 600;
}

.toc-item.toc-level-1 > .toc-row > .toc-link {
  font-weight: 600;
}

.toc-item.toc-level-2 > .toc-row > .toc-link {
  font-size: 0.89rem;
}

.toc-item.toc-level-3 > .toc-row > .toc-link {
  font-size: 0.87rem;
}

.toc-item.toc-level-4 > .toc-row > .toc-link,
.toc-item.toc-level-5 > .toc-row > .toc-link {
  font-size: 0.85rem;
  color: #6b7280;
}

.post-content {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  border: 1px solid #eef2ff;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.post-content > *:last-child {
  margin-bottom: 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin: 24px 0 14px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.2px;
  position: relative;
}

.post-content h2 {
  font-size: 1.6rem;
  border-left: 4px solid #2f6fed;
  padding-left: 12px;
}

.post-content h3 {
  font-size: 1.3rem;
}

.post-content .heading-anchor {
  margin-left: 8px;
  color: #3b82f6;
  text-decoration: none;
  border-bottom: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, color 0.18s ease;
  vertical-align: middle;
  font-size: 0.9em;
}

.post-content h1:hover > .heading-anchor,
.post-content h2:hover > .heading-anchor,
.post-content h3:hover > .heading-anchor,
.post-content h4:hover > .heading-anchor,
.post-content h5:hover > .heading-anchor,
.post-content h6:hover > .heading-anchor,
.post-content h1:focus-within > .heading-anchor,
.post-content h2:focus-within > .heading-anchor,
.post-content h3:focus-within > .heading-anchor,
.post-content h4:focus-within > .heading-anchor,
.post-content h5:focus-within > .heading-anchor,
.post-content h6:focus-within > .heading-anchor {
  opacity: 1;
  pointer-events: auto;
}

.post-content .heading-anchor:hover {
  color: #1d4ed8;
}

.post-content .heading-anchor.is-copied {
  color: #16a34a;
  opacity: 1;
  pointer-events: auto;
}

.post-content p {
  line-height: 1.6;
  margin-bottom: 14px;
  color: #334155;
  font-size: 1.03rem;
  letter-spacing: 0.02em;
}

.post-content a {
  color: #2563eb;
  text-decoration: none;
  background-image: linear-gradient(rgba(147, 197, 253, 0.95), rgba(147, 197, 253, 0.95));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: left calc(100% - 1px);
  transition: color 0.24s ease, background-size 0.3s ease;
}

.post-content a:hover {
  color: #1d4ed8;
  background-size: 100% 2px;
}

.post-content ul,
.post-content ol {
  padding-left: 24px;
  margin: 18px 0 24px;
  color: #334155;
}

.post-content li {
  margin: 8px 0;
}

.post-copyright {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fbff 0%, #f8fafc 100%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.post-copyright > div + div {
  margin-top: 10px;
}

.post-copyright-meta {
  color: #475569;
  font-weight: 600;
  margin-right: 6px;
}

.post-copyright-info {
  color: #334155;
  line-height: 1.7;
  word-break: break-all;
}

.post-copyright-info a {
  color: #2563eb;
  text-decoration: none;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.4);
}

.post-copyright-info a:hover {
  color: #1d4ed8;
  border-bottom-color: rgba(29, 78, 216, 0.72);
}

.post-content blockquote {
  border-left: 4px solid #94a3b8;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 12px;
  margin: 10px 0;
  color: #475569;
}

.post-content blockquote p {
  margin: 0;
  line-height: 1.2;
}

.post-content .file-tree-wrapper {
  margin: 18px 0;
  border: 1px solid #d7e3f4;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fe 100%);
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(30, 64, 120, 0.08);
}

.post-content .file-tree {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.post-content .file-tree[data-level="0"] {
  padding-left: 0;
}

.post-content .file-tree[data-level]:not([data-level="0"]) {
  margin-left: 16px;
  padding-left: 12px;
  border-left: 1px dashed #c7d6ec;
}

.post-content .file-tree-item {
  margin: 2px 0;
}

.post-content .file-tree-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  line-height: 1.3;
  color: #1f2f49;
  font-size: 0.94rem;
  border-radius: 8px;
  padding: 2px 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.post-content .file-tree-label:hover {
  background: rgba(59, 130, 246, 0.08);
}

.post-content .file-tree-toggle {
  cursor: pointer;
  user-select: text;
  -webkit-user-select: text;
}

.post-content .file-tree-toggle:hover .file-tree-label__inner {
  color: #1d4ed8;
}

.post-content .file-tree-icon {
  width: 16px;
  color: #64748b;
  text-align: center;
  flex-shrink: 0;
}

.post-content .file-tree-folder > .file-tree-label .file-tree-icon {
  color: #d99a06;
}

.post-content .file-tree-item:not(.file-tree-folder) > .file-tree-label .file-tree-icon {
  color: #3f5f8f;
}

.post-content .file-tree-label__inner {
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}

.post-content .admonition {
  margin: 18px 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.post-content .admonition-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
}

.post-content .admonition-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.3;
}

.post-content .admonition-title .admonition-icon {
  color: #64748b;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.post-content .admonition-title .admonition-title-text {
  display: inline;
}

.post-content .admonition-title a {
  color: #2563eb;
}

.post-content .admonition-title a:hover {
  color: #1d4ed8;
}

.post-content .admonition-toggle {
  border: none;
  background: transparent;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.post-content .admonition-toggle:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #334155;
}

.post-content .admonition-toggle .details-icon {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.post-content .admonition-toggle .details-icon.is-open {
  transform: rotate(90deg);
}

.post-content .admonition-content {
  display: grid;
  grid-template-rows: 0fr;
  color: #334155;
  line-height: 1.65;
  opacity: 0;
  transition: grid-template-rows 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.post-content .admonition.is-open .admonition-content {
  grid-template-rows: 1fr;
  opacity: 1;
}

.post-content .admonition-content-inner {
  min-height: 0;
  overflow: hidden;
  padding: 0 14px;
  transition: padding 0.24s ease;
}

.post-content .admonition.is-open .admonition-content-inner {
  padding: 12px 14px;
}

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

.post-content .admonition-content-inner > *:last-child {
  margin-bottom: 0;
}

.post-content .admonition-abstract {
  border-left: 4px solid #0ea5e9;
  border-color: #bae6fd;
  background: #f0f9ff;
}

.post-content .admonition-abstract .admonition-header {
  background: #e0f2fe;
  border-bottom-color: #bae6fd;
}

.post-content .admonition-abstract .admonition-icon,
.post-content .admonition-abstract .admonition-title,
.post-content .admonition-abstract .admonition-title a {
  color: #0369a1;
}

.post-content .admonition-info {
  border-left: 4px solid #3b82f6;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.post-content .admonition-info .admonition-header {
  background: #dbeafe;
  border-bottom-color: #bfdbfe;
}

.post-content .admonition-info .admonition-icon,
.post-content .admonition-info .admonition-title,
.post-content .admonition-info .admonition-title a {
  color: #1d4ed8;
}

.post-content .admonition-todo {
  border-left: 4px solid #06b6d4;
  border-color: #a5f3fc;
  background: #ecfeff;
}

.post-content .admonition-todo .admonition-header {
  background: #cffafe;
  border-bottom-color: #a5f3fc;
}

.post-content .admonition-todo .admonition-icon,
.post-content .admonition-todo .admonition-title,
.post-content .admonition-todo .admonition-title a {
  color: #0e7490;
}

.post-content .admonition-tip {
  border-left: 4px solid #10b981;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.post-content .admonition-tip .admonition-header {
  background: #d1fae5;
  border-bottom-color: #a7f3d0;
}

.post-content .admonition-tip .admonition-icon,
.post-content .admonition-tip .admonition-title,
.post-content .admonition-tip .admonition-title a {
  color: #047857;
}

.post-content .admonition-success {
  border-left: 4px solid #22c55e;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.post-content .admonition-success .admonition-header {
  background: #dcfce7;
  border-bottom-color: #bbf7d0;
}

.post-content .admonition-success .admonition-icon,
.post-content .admonition-success .admonition-title,
.post-content .admonition-success .admonition-title a {
  color: #15803d;
}

.post-content .admonition-question {
  border-left: 4px solid #8b5cf6;
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.post-content .admonition-question .admonition-header {
  background: #ede9fe;
  border-bottom-color: #ddd6fe;
}

.post-content .admonition-question .admonition-icon,
.post-content .admonition-question .admonition-title,
.post-content .admonition-question .admonition-title a {
  color: #6d28d9;
}

.post-content .admonition-warning {
  border-left: 4px solid #f59e0b;
  border-color: #fde68a;
  background: #fffbeb;
}

.post-content .admonition-warning .admonition-header {
  background: #fef3c7;
  border-bottom-color: #fde68a;
}

.post-content .admonition-warning .admonition-icon,
.post-content .admonition-warning .admonition-title,
.post-content .admonition-warning .admonition-title a {
  color: #b45309;
}

.post-content .admonition-failure {
  border-left: 4px solid #f43f5e;
  border-color: #fecdd3;
  background: #fff1f2;
}

.post-content .admonition-failure .admonition-header {
  background: #ffe4e6;
  border-bottom-color: #fecdd3;
}

.post-content .admonition-failure .admonition-icon,
.post-content .admonition-failure .admonition-title,
.post-content .admonition-failure .admonition-title a {
  color: #be123c;
}

.post-content .admonition-danger {
  border-left: 4px solid #ef4444;
  border-color: #fecaca;
  background: #fef2f2;
}

.post-content .admonition-danger .admonition-header {
  background: #fee2e2;
  border-bottom-color: #fecaca;
}

.post-content .admonition-danger .admonition-icon,
.post-content .admonition-danger .admonition-title,
.post-content .admonition-danger .admonition-title a {
  color: #b91c1c;
}

.post-content .admonition-bug {
  border-left: 4px solid #f97316;
  border-color: #fed7aa;
  background: #fff7ed;
}

.post-content .admonition-bug .admonition-header {
  background: #ffedd5;
  border-bottom-color: #fed7aa;
}

.post-content .admonition-bug .admonition-icon,
.post-content .admonition-bug .admonition-title,
.post-content .admonition-bug .admonition-title a {
  color: #c2410c;
}

.post-content .admonition-example {
  border-left: 4px solid #a855f7;
  border-color: #e9d5ff;
  background: #faf5ff;
}

.post-content .admonition-example .admonition-header {
  background: #f3e8ff;
  border-bottom-color: #e9d5ff;
}

.post-content .admonition-example .admonition-icon,
.post-content .admonition-example .admonition-title,
.post-content .admonition-example .admonition-title a {
  color: #7e22ce;
}

.post-content .admonition-quote {
  border-left: 4px solid #94a3b8;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.post-content .admonition-quote .admonition-header {
  background: #f1f5f9;
  border-bottom-color: #cbd5e1;
}

.post-content .admonition-quote .admonition-icon,
.post-content .admonition-quote .admonition-title,
.post-content .admonition-quote .admonition-title a {
  color: #475569;
}

.post-content .admonition-note {
  border-left: 4px solid #64748b;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.post-content .admonition-note .admonition-header {
  background: #f1f5f9;
  border-bottom-color: #cbd5e1;
}

.post-content .admonition-note .admonition-icon,
.post-content .admonition-note .admonition-title,
.post-content .admonition-note .admonition-title a {
  color: #334155;
}

.post-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 18px 0;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.post-image-wrapper {
  margin: 22px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.post-image-wrapper .post-image {
  margin: 0;
  cursor: zoom-in;
}

.post-image-caption {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
  padding: 0 10px;
  word-break: break-word;
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(2px);
  padding: 24px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.34s ease;
}

.image-preview-overlay.is-visible {
  opacity: 1;
}

.image-preview-overlay.is-hiding {
  opacity: 0;
}

.image-preview-frame {
  --image-preview-scale: 1;
  position: fixed;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  background: #fff;
  transform-origin: center center;
  transition: left 0.36s cubic-bezier(0.2, 0.7, 0.2, 1), top 0.36s cubic-bezier(0.2, 0.7, 0.2, 1), width 0.36s cubic-bezier(0.2, 0.7, 0.2, 1), height 0.36s cubic-bezier(0.2, 0.7, 0.2, 1), border-radius 0.36s ease, box-shadow 0.36s ease;
}

.image-preview-frame.is-hiding {
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.24);
}

.image-preview-content {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-out;
  transform: scale(var(--image-preview-scale));
  transform-origin: center center;
  transition: transform 0.14s ease;
  will-change: auto;
}

.image-preview-zoom-hint {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.image-preview-zoom-hint.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.image-preview-close {
  position: absolute;
  top: 24px;
  right: 24px;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.image-preview-close:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.05);
}

@keyframes previewFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes previewFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes previewZoomIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes previewZoomOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.96);
    opacity: 0;
  }
}

.file-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  animation: previewFadeIn 0.2s ease forwards;
}

.file-preview-overlay[hidden] {
  display: none !important;
  pointer-events: none;
}

.file-preview-overlay.is-hiding {
  animation: previewFadeOut 0.18s ease forwards;
  pointer-events: none;
}

.file-preview-panel {
  width: min(1140px, 96vw);
  height: min(88vh, 900px);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbeafe;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  opacity: 0;
  animation: previewZoomIn 0.22s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.file-preview-header {
  height: 58px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 16px;
  background: rgba(248, 250, 252, 0.92);
}

.file-preview-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
}

.file-preview-title i {
  color: #4f46e5;
}

.file-preview-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.file-preview-nav-btn {
  height: 34px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #dbe4ff;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-preview-nav-btn i {
  font-size: 0.78rem;
  flex: 0 0 auto;
}

.file-preview-nav-btn span {
  display: inline-block;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

.file-preview-nav-btn:hover {
  border-color: #c7d2fe;
  color: #4338ca;
  background: #eef2ff;
}

.file-preview-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.file-preview-nav-index {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 700;
  white-space: nowrap;
  padding: 0 6px;
}

.file-preview-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.file-preview-copy,
.file-preview-download,
.file-preview-close {
  height: 34px;
  border-radius: 999px;
  border: 1px solid #dbe4ff;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-preview-close {
  width: 34px;
  padding: 0;
}

.file-preview-download:hover,
.file-preview-close:hover,
.file-preview-copy:hover {
  border-color: #c7d2fe;
  color: #4338ca;
  background: #eef2ff;
}

.file-preview-copy.is-success {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.file-preview-body {
  flex: 1;
  min-height: 0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.file-preview-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #475569;
  font-size: 0.92rem;
}

.file-preview-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.18);
}

.file-preview-text {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #dbe4ff;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8ff 100%);
  color: #1e293b;
  padding: 16px;
  font-size: 1.04rem;
  line-height: 1.8;
}

.file-preview-text code {
  background: transparent;
  color: inherit;
}

.file-preview-code {
  width: 100%;
  height: 100%;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #dbe4ff;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7ff 100%);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.08);
  position: relative;
}

.file-preview-code::before {
  content: attr(data-language);
  position: sticky;
  top: 0;
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  margin: 10px 0 8px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.14);
  color: #4338ca;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
}

.file-preview-code-line {
  display: grid;
  grid-template-columns: 66px 1fr;
  min-height: 30px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 1rem;
  line-height: 1.9;
}

.file-preview-code-line .line-no {
  user-select: none;
  text-align: right;
  padding: 0 12px 0 0;
  color: #94a3b8;
  background: rgba(226, 232, 255, 0.7);
  border-right: 1px solid rgba(148, 163, 184, 0.28);
}

.file-preview-code-line .line-text {
  display: block;
  padding: 0 14px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: #1f2937;
}

.file-preview-code-wrap {
  width: 100%;
  height: 100%;
  position: relative;
}

.file-preview-json-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-preview-json-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-preview-json-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-weight: 700;
}

.file-preview-json-title small {
  color: #64748b;
  font-weight: 600;
}

.file-preview-json-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.file-preview-json-actions .file-preview-floating-copy {
  position: static;
  top: auto;
  right: auto;
  margin-left: 2px;
}

.file-preview-json-btn {
  border: 1px solid #dbe4ff;
  background: #fff;
  color: #334155;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.file-preview-json-btn:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.file-preview-json-code {
  flex: 1;
  min-height: 0;
}

.file-preview-json-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 30px;
}

.file-preview-json-more {
  border: 1px solid #dbe4ff;
  background: #fff;
  color: #4338ca;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.file-preview-json-more:hover {
  background: #eef2ff;
}

.file-preview-json-status {
  color: #64748b;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
}

.file-preview-json-code .line-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.json-fold-toggle,
.json-fold-pad {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.json-fold-toggle {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  cursor: pointer;
  padding: 0;
}

.json-fold-toggle:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.json-fold-pad {
  border: 1px solid transparent;
}

.file-preview-floating-copy {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
  border: 1px solid rgba(165, 180, 252, 0.5);
  background: rgba(255, 255, 255, 0.9);
  color: #4338ca;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.12);
}

.file-preview-floating-copy:hover {
  background: rgba(238, 242, 255, 0.95);
  border-color: rgba(129, 140, 248, 0.6);
  color: #3730a3;
}

.file-preview-floating-copy.is-disabled,
.file-preview-floating-copy:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
  box-shadow: none;
}

.file-preview-rich {
  width: 100%;
  height: 100%;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #ffffff;
  padding: 16px;
}

.docx-preview {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #1e293b;
}

.sheet-preview-title {
  font-size: 0.88rem;
  color: #475569;
  margin-bottom: 10px;
}

.sheet-preview-wrap {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.sheet-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.sheet-preview-table td {
  border: 1px solid #e2e8f0;
  padding: 6px 8px;
  white-space: nowrap;
}

.sheet-preview-table tr.is-header td {
  background: #f8fafc;
  font-weight: 700;
}

.ppt-preview {
  display: grid;
  gap: 12px;
}

.ppt-preview-slide {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  padding: 12px 14px;
}

.ppt-preview-slide h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #334155;
}

.ppt-preview-slide p {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: #1e293b;
  line-height: 1.6;
}

.archive-preview-manager {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.archive-toolbar-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.archive-search,
.archive-sort {
  height: 34px;
  border: 1px solid #dbe4ff;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 0.82rem;
  padding: 0 10px;
}

.archive-preview-stats {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

.archive-search {
  min-width: 220px;
}

.archive-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.archive-tree,
.archive-table-pane,
.archive-text-pane {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  min-height: 0;
}

.archive-preview-single .archive-tree {
  overflow: auto;
  padding: 8px;
}

.archive-tree-list {
  list-style: none;
  margin: 0;
  padding-left: 10px;
}

.archive-tree-node {
  margin: 2px 0;
}

.archive-tree-toggle,
.archive-tree-file {
  width: 100%;
  border: none;
  background: transparent;
  color: #334155;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  font-size: 1.04rem;
  font-weight: 620;
  line-height: 1.32;
}

.archive-tree-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.archive-tree-file {
  flex: 1;
  min-width: 0;
}

.archive-tree-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-tree-file-size {
  flex: 0 0 auto;
  font-size: 0.9rem;
  color: #64748b;
  padding-right: 9px;
  white-space: nowrap;
  font-weight: 580;
}

.archive-tree-toggle:hover,
.archive-tree-file:hover {
  background: #eef2ff;
  color: #3730a3;
}

.archive-tree-toggle i,
.archive-tree-file i {
  font-size: 0.98rem;
  flex: 0 0 auto;
}

.archive-tree-empty {
  color: #64748b;
  font-size: 0.98rem;
  padding: 12px;
}

.archive-preview-wrap {
  overflow: auto;
  border-radius: 10px;
  background: #fff;
  height: 100%;
}

.archive-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 760px;
}

.archive-preview-table th,
.archive-preview-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  text-align: left;
  color: #334155;
}

.archive-preview-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  font-weight: 700;
  z-index: 1;
}

.archive-preview-table tbody tr.is-clickable {
  cursor: pointer;
}

.archive-preview-table tbody tr.is-clickable:hover {
  background: #f8faff;
}

.archive-preview-table .archive-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 420px;
}

.archive-preview-table .archive-name i {
  color: #64748b;
}

.archive-text-pane {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.archive-text-header {
  height: 38px;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-text-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.archive-text-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.86rem;
  text-align: center;
  padding: 12px;
}

.file-preview-frame {
  width: 100%;
  height: 100%;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
}

.file-preview-empty {
  width: min(560px, 100%);
  min-height: 220px;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #475569;
  text-align: center;
  padding: 20px;
}

.file-preview-empty i {
  font-size: 2.1rem;
  color: #64748b;
}

.file-preview-empty p {
  margin: 0;
  font-size: 0.9rem;
}

.post-content .file-ref-card {
  --file-accent: #4f46e5;
  --file-bg: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  --file-border: #dbe4ff;
  margin: 14px 14px 0 0;
  width: calc((100% - 18px) / 2);
  border: 1px solid var(--file-border);
  background: var(--file-bg);
  border-radius: 14px;
  padding: 12px 14px 12px 12px;
  display: inline-grid;
  vertical-align: top;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-content .file-ref-card:nth-of-type(2n) {
  margin-right: 0;
}

.post-content .file-ref-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(79, 70, 229, 0.16);
  border-color: color-mix(in srgb, var(--file-accent) 40%, white 60%);
}

.post-content .file-ref-card.is-doc {
  --file-accent: #2563eb;
}

.post-content .file-ref-card.is-sheet {
  --file-accent: #16a34a;
}

.post-content .file-ref-card.is-slide {
  --file-accent: #ea580c;
}

.post-content .file-ref-card.is-text {
  --file-accent: #0f766e;
}

.post-content .file-ref-card.is-script,
.post-content .file-ref-card.is-code-md,
.post-content .file-ref-card.is-code-c,
.post-content .file-ref-card.is-code-java,
.post-content .file-ref-card.is-code-python,
.post-content .file-ref-card.is-code-go,
.post-content .file-ref-card.is-code-html,
.post-content .file-ref-card.is-code-js,
.post-content .file-ref-card.is-code-css,
.post-content .file-ref-card.is-code-json,
.post-content .file-ref-card.is-code-yaml,
.post-content .file-ref-card.is-code-sql {
  --file-accent: #7c3aed;
}

.post-content .file-ref-card.is-image {
  --file-accent: #db2777;
}

.post-content .file-ref-card.is-archive {
  --file-accent: #b45309;
}

.post-content .file-ref-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--file-accent) 16%, white 84%);
  color: var(--file-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--file-accent) 26%, white 74%);
}

.post-content .file-ref-main {
  min-width: 0;
}

.post-content .file-ref-title {
  font-size: 0.96rem;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-content .file-ref-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.83rem;
}

.post-content .file-ref-ext,
.post-content .file-ref-size,
.post-content .file-ref-desc {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef2ff;
  border: 1px solid #dde5ff;
}

.post-content .file-ref-actions {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.post-content .file-ref-card:hover .file-ref-actions,
.post-content .file-ref-card:focus-within .file-ref-actions {
  opacity: 1;
  transform: translateY(0);
}

.post-content .file-ref-action {
  border: 1px solid #dbe4ff;
  background: #f8fbff;
  color: #334155;
  border-radius: 999px;
  height: 30px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-content .file-ref-action:hover {
  border-color: color-mix(in srgb, var(--file-accent) 40%, white 60%);
  color: var(--file-accent);
  background: color-mix(in srgb, var(--file-accent) 10%, white 90%);
}

@media (max-width: 900px) {
  .post-content .file-ref-card {
    width: 100%;
    margin-right: 0;
    grid-template-columns: 42px 1fr;
    gap: 10px;
  }

  .post-content .file-ref-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .post-content .file-ref-actions {
    position: static;
    grid-column: 1 / -1;
    justify-content: flex-end;
    opacity: 1;
    transform: none;
    margin-top: 2px;
  }

  .file-preview-overlay {
    padding: 10px;
  }

  .file-preview-panel {
    width: 100%;
    height: min(90vh, 980px);
    border-radius: 12px;
  }

  .file-preview-header {
    height: auto;
    min-height: 54px;
    padding: 10px;
    gap: 10px;
    align-items: stretch;
    flex-direction: column;
  }

  .file-preview-title {
    width: 100%;
    order: 1;
  }

  .file-preview-nav {
    width: 100%;
    justify-content: space-between;
    order: 2;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .file-preview-nav-btn {
    flex: 0 0 auto;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .file-preview-header-actions {
    width: 100%;
    justify-content: flex-end;
    order: 3;
  }

  .archive-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 32%) minmax(180px, 34%) minmax(200px, 1fr);
  }

  .archive-search {
    min-width: 0;
    width: 100%;
  }
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.06);
}

.post-content th,
.post-content td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 0.95rem;
}

.post-content th {
  background: #f8fafc;
  color: #1e293b;
  font-weight: 600;
}

.post-content code {
  background: #f1f5ff;
  color: #1e3a8a;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: "JetBrains Mono", "Fira Code", "Source Code Pro", monospace;
}

.post-content pre {
  background: #f8fafc;
  color: #1f2937;
  padding: 6px 36px 6px 0;
  border-radius: 12px;
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
  position: relative;
  font-family: "JetBrains Mono", "Fira Code", "Source Code Pro", monospace;
  transition: max-height 0.4s ease, box-shadow 0.3s ease;
  max-width: 100%;
}

.post-content pre.is-collapsible {
  overflow: hidden;
}

.post-content pre.is-collapsible::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
  pointer-events: none;
}

.post-content pre.is-collapsed {
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.post-content .code-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 44px;
  height: 70px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.92) 60%, rgba(248, 250, 252, 1) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-content pre.is-collapsed .code-fade {
  opacity: 1;
}

/* 折叠代码块：第 17~20 行渐进模糊，视觉更自然 */
.post-content pre.is-collapsed code .code-line:nth-child(17) .code-line-text {
  filter: blur(0.35px);
  opacity: 0.92;
}

.post-content pre.is-collapsed code .code-line:nth-child(18) .code-line-text {
  filter: blur(0.75px);
  opacity: 0.8;
}

.post-content pre.is-collapsed code .code-line:nth-child(19) .code-line-text {
  filter: blur(1.2px);
  opacity: 0.64;
}

.post-content pre.is-collapsed code .code-line:nth-child(20) .code-line-text {
  filter: blur(1.8px);
  opacity: 0.5;
}

.post-content pre.is-collapsed code .code-line:nth-child(21) .code-line-text {
  filter: blur(2.2px);
  opacity: 0.2;
}

.post-content .code-toggle {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  border: none;
  background: #ffffff;
  color: #1f2937;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.post-content .code-toggle i {
  font-size: 0.8rem;
}

.post-content .code-toggle:hover {
  transform: translateX(-50%) translateY(-1px);
  background: #2563eb;
  color: #fff;
  box-shadow: 0 12px 20px rgba(37, 99, 235, 0.25);
}

.post-content pre.is-collapsed .code-toggle {
  animation: none;
}

.post-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.35;
  display: block;
  font-family: inherit;
}

.post-content pre code .code-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: stretch;
  min-height: 1.35em;
  transition: background-color 0.18s ease;
}

.post-content pre code .code-line:hover {
  background: rgba(37, 99, 235, 0.16);
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.9);
}

.post-content pre code .code-line-no {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: right;
  user-select: none;
  color: #94a3b8;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0 10px 0 0;
  font-variant-numeric: tabular-nums;
}

.post-content pre code .code-line:hover .code-line-no {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}

.post-content pre code .code-line-text {
  display: block;
  white-space: pre;
  padding: 0 10px 0 12px;
  min-width: max-content;
}

.post-content pre .hljs,
.post-content pre .hljs * {
  font-family: inherit;
}

.post-content pre.code-block::after {
  content: attr(data-language);
  position: absolute;
  top: 2px;
  left: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: capitalize;
}

.post-content .copy-button {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: #f1f5f9;
  color: #475569;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.1);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.post-content .copy-button:hover {
  background: #2563eb;
  color: #fff;
  transform: translateY(-2px);
}

.post-content .copy-button:active {
  transform: translateY(0);
}

.post-content .copy-button.is-success {
  background: #16a34a;
  color: #fff;
}

.post-content .copy-flash {
  animation: codeBlink 0.3s ease-in-out 2;
}

@keyframes codeBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.post-content pre::-webkit-scrollbar {
  height: 8px;
}

.post-content pre::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
}

.card p {
  color: var(--muted);
  line-height: 1.6;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.meta-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow: hidden;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.meta-item i {
  color: #64748b;
}

.tag-group {
  max-width: 100%;
  min-width: 0;
  flex: 1;
}

.tag-chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.tag-chips .meta-chip {
  max-width: 100%;
}

.tag-chips .tag-chip {
  max-width: min(160px, 100%);
}

.tag-chip {
  flex: 0 0 auto;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 12px 0 36px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #d9dee8;
  border-radius: 6px;
  background: #fff;
  color: #4b5568;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background: #f5f7fa;
  border-color: #c8cfdd;
  color: #2f3747;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #495163;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.page-num:hover:not(.is-active) {
  background: #f5f7fa;
  border-color: #d9dee8;
  color: #2f3747;
}

.page-num.is-active {
  background: #2f6feb;
  color: #fff;
  border-color: #2f6feb;
  cursor: default;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  color: #99a2b3;
  font-size: 0.84rem;
  letter-spacing: 1px;
  user-select: none;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid #e3e7ef;
}

#page-jump-input {
  width: 56px;
  height: 32px;
  text-align: center;
  border: 1px solid #d9dee8;
  border-radius: 6px;
  background: #fff;
  color: #2f3747;
  font-size: 0.84rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#page-jump-input:focus {
  border-color: #8da2c0;
  box-shadow: 0 0 0 2px rgba(47, 111, 235, 0.12);
}

#page-jump-input::placeholder {
  color: #a4adbd;
  font-weight: 400;
}

#page-jump-btn {
  height: 32px;
  padding: 0 11px;
  border: 1px solid #d9dee8;
  border-radius: 6px;
  background: #fff;
  color: #4b5568;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

#page-jump-btn:hover {
  background: #f5f7fa;
  border-color: #c8cfdd;
  color: #2f3747;
}

.tag {
  background: #eef2ff;
  color: #395bd8;
  padding: 4px 10px;
  border-radius: 999px;
}

.meta .link {
  color: var(--primary);
  font-weight: 600;
}

.post-meta {
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
}

.post-meta .meta-row {
  gap: 10px;
  align-items: center;
}

.post-meta .author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1f2937;
  font-weight: 600;
  text-decoration: none;
}

.post-meta .author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
}

.post-meta .meta-divider,
.post-meta .meta-label {
  color: #9ca3af;
}

.post-meta .meta-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.post-meta .meta-link:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.post-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid #e6e8ed;
  background: #f8f9fb;
  color: #334155;
  line-height: 1.25;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.post-meta .meta-item:hover {
  background: #f2f4f8;
  border-color: #d8dde6;
}

.post-meta .meta-item i {
  color: #6b7280;
}

.footer {
  padding: 30px 0 40px;
  color: var(--muted);
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.footer-line {
  margin: 0;
  line-height: 1.45;
}

.footer-runtime {
  color: #6b7280;
  font-size: 0.92rem;
}

.beian {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.9rem;
}

.beian a {
  color: #6b7280;
  text-decoration: none;
}

.beian a:hover {
  color: #4f5db5;
  text-decoration: underline;
}

.footer-divider::before {
  content: "|";
  color: #c5c9d6;
  margin-right: 10px;
}

.loading {
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
  width: 100%;
}

.not-found-wrap {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 54px 0 72px;
}

.not-found-card {
  width: min(980px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(250, 252, 255, 0.95));
  border: 1px solid #e5eafc;
  border-radius: 24px;
  padding: 44px 40px;
  box-shadow: 0 18px 40px rgba(120, 138, 226, 0.16);
}

.not-found-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 32px;
  align-items: start;
}

.not-found-left {
  text-align: left;
}

.not-found-right {
  padding-left: 8px;
}

.not-found-left .not-found-actions {
  justify-content: flex-start;
}

.not-found-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #d8e4ff;
  background: #eef4ff;
  color: #4f62b8;
  font-weight: 700;
  font-size: 0.9rem;
}

.not-found-title {
  margin-top: 16px;
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  color: #2b376f;
  letter-spacing: 1px;
}

.not-found-desc {
  margin: 14px auto 0;
  max-width: 520px;
  color: #627092;
  line-height: 1.8;
  font-size: 1rem;
}

.not-found-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.not-found-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid #dde5ff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: #52618f;
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.not-found-btn:hover {
  transform: translateY(-2px);
  border-color: #cdd9ff;
  color: #344787;
  box-shadow: 0 10px 22px rgba(123, 141, 245, 0.18);
}

.not-found-btn.primary {
  background: linear-gradient(135deg, #e5ecff, #f1f4ff);
  border-color: #d2dcff;
  color: #4456a8;
}

.not-found-search-block,
.not-found-recent-block {
  text-align: left;
  border-top: 1px solid #e9efff;
  padding-top: 18px;
}

.not-found-right .not-found-search-block {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.not-found-right .not-found-recent-block {
  margin-top: 18px;
}

.not-found-search-block h3,
.not-found-recent-block h3 {
  margin: 0;
  color: #3f4f88;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.not-found-search-form {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.not-found-search-form input {
  border: 1px solid #dce5ff;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 0.95rem;
  background: #fff;
  color: #3c4c7a;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.not-found-search-form input:focus {
  border-color: #b8c8ff;
  box-shadow: 0 0 0 3px rgba(173, 196, 255, 0.28);
}

.not-found-search-form button {
  border: 1px solid #cedbff;
  background: linear-gradient(135deg, #edf2ff, #f8faff);
  color: #4456a8;
  border-radius: 12px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.not-found-search-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(124, 144, 232, 0.2);
}

.not-found-recent-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.not-found-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  border: 1px solid #e2e9ff;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
  color: #4f5f8d;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.not-found-recent-item:hover {
  border-color: #cfdcff;
  background: #ffffff;
  transform: translateY(-1px);
}

.not-found-recent-title {
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.not-found-recent-date {
  font-size: 0.84rem;
  color: #8a97b6;
  flex-shrink: 0;
}

.not-found-recent-empty {
  color: #7b88a7;
  font-size: 0.93rem;
  padding: 10px 0;
}

@media (max-width: 900px) {
  .not-found-main {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .not-found-right {
    padding-left: 0;
  }

  .not-found-right .not-found-search-block {
    border-top: 1px solid #e9efff;
    padding-top: 18px;
  }
}

@media (max-width: 768px) {
  .not-found-card {
    padding: 32px 22px;
  }

  .not-found-search-form {
    grid-template-columns: 1fr;
  }

  .not-found-search-form button {
    height: 42px;
  }

  .not-found-recent-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* --- Main Layout --- */
.main-container {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 24px;
  align-items: flex-start;
  margin-top: 20px;
  margin-bottom: 84px;
}

.post-area {
  min-width: 0; /* Prevent overflow in grid layouts */
}

.sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Sidebar cards */
.sidebar-card {
  background: var(--card);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border);
}

.sidebar-card:hover {
  box-shadow: 0 16px 32px rgba(18, 38, 63, 0.08);
}

/* Author card */
.author-card {
  text-align: center;
  background: linear-gradient(145deg, #eef1ff, #fafbff);
}

.author-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 12px;
}

.author-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.author-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.author-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  padding: 10px 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.stat-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.stat-count {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.homepage-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #dfe6ff, #edf1ff);
  color: #4f5db5;
  border: 1px solid #d7dfff;
  padding: 12px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.homepage-button:hover {
  background: linear-gradient(135deg, #d4ddff, #e8ecff);
  box-shadow: 0 12px 24px rgba(122, 141, 245, 0.24);
  transform: translateY(-2px);
}

.visitor-stats {
  margin: 2px 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
}

.visitor-stats-footer {
  width: min(420px, 100%);
}

.visitor-stats-text {
  margin: 0;
  color: #6b7280;
  font-size: 0.92rem;
  line-height: 1.45;
}

.visitor-stats-text i {
  margin-right: 4px;
}

.visitor-stat-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.visitor-stat-link:hover {
  color: #1f2937;
}

.visitor-stats-separator {
  margin: 0 6px;
  opacity: 0.75;
}

.visitor-stat-value {
  color: inherit;
  font-weight: 700;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.visitor-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
}

.visitor-detail-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.62), rgba(30, 41, 59, 0.56));
  backdrop-filter: blur(4px);
}

.visitor-detail-panel {
  position: relative;
  width: min(1080px, 94vw);
  max-height: 84vh;
  margin: 6vh auto 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 18px;
  border: 1px solid #dbe2ff;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.visitor-detail-header {
  min-height: 60px;
  padding: 12px 16px;
  border-bottom: 1px solid #e3e8ff;
  background: linear-gradient(135deg, #eef2ff 0%, #f6f8ff 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.visitor-detail-header h3 {
  color: #37459a;
  font-size: 1.02rem;
  font-weight: 700;
}

.visitor-detail-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #cfd8ff;
  background: #ffffff;
  color: #5161bd;
  cursor: pointer;
  transition: all 0.2s ease;
}

.visitor-detail-close:hover {
  background: #eef2ff;
  border-color: #b9c8ff;
}

.visitor-detail-table-wrap {
  overflow: auto;
  padding: 12px;
}

.visitor-detail-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.visitor-detail-table th,
.visitor-detail-table td {
  border-bottom: 1px solid #edf0f7;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #334155;
  text-align: left;
  vertical-align: top;
}

.visitor-detail-table td:nth-child(3),
.visitor-detail-table td:nth-child(4) {
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 280px;
}

.visitor-detail-table tbody tr:hover {
  background: #f8faff;
}

.visitor-detail-table th {
  position: sticky;
  top: 0;
  background: #f4f7ff;
  color: #4252a8;
  font-weight: 700;
  z-index: 1;
}

.visitor-detail-footer {
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: center;
  background: #fbfcff;
}

.visitor-detail-more {
  border: 1px solid #cfd9ff;
  background: linear-gradient(135deg, #edf2ff, #f7f9ff);
  color: #4f5db5;
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.visitor-detail-more:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(79, 93, 181, 0.2);
}

.social-links .social-link {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.06rem;
  color: #5b6477;
  background: #f3f5fa;
  border: 1px solid #e3e7f0;
  transition: all 0.2s ease;
}

.social-links .social-link:hover {
  transform: translateY(-1px);
  background: #eef2f8;
  border-color: #d4dae6;
}

.social-link-github {
  color: #576174;
}

.social-link-email {
  color: #4e6a8a;
}

.social-link-qq {
  color: #4b6982;
}

.social-link-wechat {
  color: #07c160;
}

.social-link-rss {
  color: #6e604f;
}

/* Tag cloud card */
.tag-cloud-card {
  background: #ffffff;
  border: 1px solid #e7eaf3;
}

.tag-cloud-card .card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #374151;
}

.tag-cloud {
  display: block;
}

.tag-cloud-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.tag-cloud-list.is-collapsed {
  position: relative;
}

.tag-cloud-list.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff 78%);
}

.tag-cloud-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #dfe3ea;
  background: #f8fafc;
  color: #475569;
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.3;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.tag-cloud-name {
  display: inline-block;
  max-width: 116px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-cloud-count {
  margin-left: 6px;
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 600;
}

.tag-cloud-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.tag-cloud-item:active {
  background: #e2e8f0;
}

.tag-cloud-toggle {
  width: 100%;
  margin-top: 8px;
  padding: 6px 0;
  border: none;
  border-top: 1px solid #eef2f7;
  background: transparent;
  color: #64748b;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: color 0.18s ease;
}

.tag-cloud-toggle:hover {
  color: #334155;
}

.tag-cloud-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Post card animation */
.post-list .card {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.5s ease-out forwards;
  animation-delay: calc(0.05s * var(--i));
  z-index: 1;
}

.post-list .card:hover,
.post-list .card:focus-within {
  z-index: 50;
}

.card:focus-within {
  background-color: #f8fafc;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Widgets --- */
.widgets-area {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.widget {
  background: #ffffff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  border: 1px solid #e6eaf0;
}

.widget:hover {
  border-color: #d7dde8;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

/* Clock Widget */
#clock-widget {
  background: #ffffff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
}

.clock-display {
  width: 100%;
  display: grid;
  gap: 2px;
  justify-items: center;
  line-height: 1.2;
}

.clock-date {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #334155;
}

.clock-time {
  font-size: 0.84rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}


/* --- Responsive Design --- */

/* For tablets and smaller desktops */
@media (max-width: 1200px) {
  .container {
    width: min(1080px, 94%);
  }
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .top-nav .nav-links {
    justify-content: flex-start;
  }
  .main-container {
    grid-template-columns: 1fr 300px; /* 2-column layout */
  }
  .widgets-area {
    display: none; /* Hide widgets */
  }
  .post-layout {
    grid-template-columns: minmax(200px, 220px) 1fr minmax(200px, 240px);
    gap: 24px;
  }
}

/* 文章页：900px ~ 1100px 仅隐藏右侧合集，保留目录 */
@media (max-width: 1100px) and (min-width: 901px) {
  .post-layout {
    grid-template-columns: minmax(200px, 240px) 1fr;
  }

  .collection-panel {
    display: none;
  }
}

@media (max-width: 900px) {
  .container {
    width: min(720px, 96%);
  }

  .post-lock-screen {
    grid-column: 1;
    width: 100%;
    min-height: 360px;
    padding: 28px 18px;
  }

  .post-lock-input-wrap {
    flex-direction: column;
  }

  .post-lock-input,
  .post-lock-btn {
    width: 100%;
  }

  /* Switch to a single-column flex layout */
  .main-container {
    display: flex;
    flex-direction: column;
  }

  /* Move sidebar to the top */
  .sidebar {
    position: relative; /* Reset sticky positioning */
    top: 0;
    order: -1;
    margin-bottom: 32px;
    width: 100%;
  }

  /* Adjust other layouts for smaller screens */
  .post-layout {
    grid-template-columns: 1fr;
    gap: 0;
    margin: 28px 0 60px;
  }

  .toc,
  .collection-panel {
    display: none;
  }

  .post-main {
    padding: 22px;
  }

  .post-content {
    padding: 20px;
  }

  .post-copyright {
    padding: 14px;
  }

  .meta-layout {
    grid-template-columns: 1fr;
  }
}

/* For mobile phones */
@media (max-width: 700px) {
  .hero {
    padding: 40px 0;
  }

  .search-box {
    min-width: 0;
  }

  .category-filters {
    gap: 6px;
    margin-top: 0;
    padding-bottom: 4px;
  }

  .category-filters-list {
    max-height: 64px;
    gap: 6px;
    padding-right: 36px;
  }

  .category-filters-list.is-expanded {
    padding-right: 0;
  }

  .category-expand-btn {
    width: 28px;
    height: 28px;
    margin-bottom: 1px;
  }

  .category-filter-chip {
    padding: 6px 9px;
    font-size: 0.8rem;
  }

  .category-filter-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.72rem;
  }

  .post-content {
    padding: 20px;
  }

  .post-summary {
    padding: 12px 12px 12px 40px;
    font-size: 0.96rem;
    line-height: 1.72;
  }

  .post-summary::before {
    left: 12px;
    top: 12px;
  }

  .post-summary::after {
    right: 10px;
  }
}

.friends-hero {
  padding: 16px 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(125, 211, 252, 0.28), transparent 46%),
    radial-gradient(circle at 84% 88%, rgba(196, 181, 253, 0.26), transparent 44%),
    linear-gradient(120deg, #eff6ff, #f8fafc 45%, #eef2ff);
}

.friends-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid #bfdbfe;
  color: #2563eb;
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.friends-hero .hero-subtitle {
  font-size: 0.95rem;
  color: #475569;
}

.friends-main-container {
  width: min(1200px, 84%);
}

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

.friends-section-head h2 {
  font-size: 1.08rem;
}

.friends-count {
  color: #475569;
  background: #eef2ff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
}

.friends-preview-layout {
  display: block;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.friend-preview-panel {
  position: fixed;
  z-index: 1200;
  width: min(560px, calc(100vw - 24px));
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #dbeafe;
  border-radius: 16px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  left: 12px;
  top: 12px;
}

.friend-preview-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.friend-preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e3a8a;
  font-weight: 700;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.friend-preview-body {
  min-height: 360px;
  padding: 12px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.friend-preview-image {
  width: 100%;
  min-height: 320px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  object-fit: contain;
  background: #f8fafc;
}

.friend-preview-caption {
  margin: 0;
  font-size: 0.86rem;
  color: #64748b;
  text-align: center;
}

.friend-preview-failed {
  min-height: 320px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  color: #64748b;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 22px 14px;
}

.friend-preview-failed i {
  font-size: 1.8rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.friend-preview-failed-text {
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.friend-preview-failed p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.7;
}

.friend-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px;
  color: #111827;
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.2s ease;
}

.friend-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(14, 165, 233, 0.12)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.friend-card:hover {
  transform: translateY(-4px);
  border-color: #dbeafe;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.friend-card:hover::after {
  opacity: 1;
}

.friend-avatar {
  width: 68px;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 8px;
  background: #f8fafc;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.friend-card:hover .friend-avatar img {
  transform: scale(1.04);
}

.friend-content {
  text-align: center;
}

.friend-content h3 {
  margin: 0 0 4px;
  font-size: 0.9rem;
}

.friend-content p {
  margin: 0;
  color: #6b7280;
  font-size: 0.8rem;
  line-height: 1.45;
}

.friends-extra-card {
  margin-top: 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.friends-extra-card h2 {
  margin-bottom: 12px;
  font-size: 1.08rem;
}

.notice-box {
  background: linear-gradient(180deg, #f0f9ff, #ecfeff);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 12px;
}

.notice-box ol {
  margin-left: 18px;
  line-height: 1.8;
}

#my-friend-profile-content {
  background: linear-gradient(180deg, #f8fbff, #f1f5ff);
  color: #334155;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #dbeafe;
}

.friend-comment-form {
  display: grid;
  gap: 10px;
}

.comment-meta-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.friend-comment-form input,
.friend-comment-form textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.friend-comment-form input:focus,
.friend-comment-form textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.comment-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-char-count {
  color: #64748b;
  font-size: 0.82rem;
}

#friend-comment-result {
  color: #0f766e;
  font-size: 0.9rem;
  margin-left: auto;
}

#friend-comment-submit {
  min-width: 96px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: linear-gradient(135deg, #dbeafe, #f0f9ff);
  color: #1d4ed8;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#friend-comment-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(59, 130, 246, 0.18);
  border-color: #60a5fa;
}

#friend-comment-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.friend-comment-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.comment-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f9fafb;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.comment-card:hover {
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 0.85rem;
}

.comment-nickname-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

.comment-nickname-link:hover {
  text-decoration: underline;
}

.comment-top {
  margin-left: 8px;
  font-size: 0.78rem;
  color: #0ea5e9;
}

.comment-content {
  color: #111827;
  line-height: 1.7;
  white-space: pre-wrap;
}

.comment-list-title {
  margin-top: 14px;
  font-weight: 600;
}

@media (max-width: 1200px) {
  .friends-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 900px) {
  .friends-main-container {
    width: min(1040px, 88%);
  }

  .friends-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .friend-preview-panel {
    width: min(94vw, 520px);
  }

  .comment-meta-row {
    grid-template-columns: 1fr;
  }

  .comment-form-actions {
    flex-wrap: wrap;
  }

  #friend-comment-result {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .friends-main-container {
    width: min(1040px, 92%);
  }

  .friends-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }
}

/* --- GitHub Trending Widget --- */
#github-trending-widget {
  background: #ffffff;
  border: 1px solid #e6eaf0;
  padding: 10px;
}

.github-trending-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.github-trending-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
}

.github-trending-list {
  display: grid;
  gap: 4px;
}

.github-trending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-decoration: none;
  border: 1px solid #e8ecf3;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px 8px;
  color: #1f2a44;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.github-trending-item:hover {
  border-color: #d5dce8;
  background-color: #f8fafc;
}

.github-trending-item-title {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.github-trending-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.72rem;
  white-space: nowrap;
}

.github-trending-more {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  color: #64748b;
  text-decoration: none;
  white-space: nowrap;
}

.github-trending-more:hover {
  color: #334155;
  text-decoration: underline;
}

.github-trending-empty {
  color: #7b849f;
  font-size: 0.8rem;
  padding: 4px 0;
}

/* --- Cnblogs News Widget --- */
#cnblogs-news-widget {
  background: #ffffff;
  border: 1px solid #e6eaf0;
  padding: 10px;
}

.cnblogs-news-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.cnblogs-news-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
}

.cnblogs-news-list {
  display: grid;
  gap: 4px;
}

.cnblogs-news-item {
  display: grid;
  gap: 4px;
  border: 1px solid #e8ecf3;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px 8px;
  color: #1f2a44;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cnblogs-news-item:hover {
  border-color: #d5dce8;
  background-color: #f8fafc;
}

.cnblogs-news-item-title {
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.cnblogs-news-item-title:hover {
  color: #0f172a;
  text-decoration: underline;
}

.cnblogs-news-item-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #64748b;
  font-size: 0.72rem;
}

.cnblogs-news-tag-link {
  color: #64748b;
  text-decoration: none;
}

.cnblogs-news-tag-link:hover {
  color: #334155;
  text-decoration: underline;
}

.cnblogs-news-more {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  color: #64748b;
  text-decoration: none;
  white-space: nowrap;
}

.cnblogs-news-more:hover {
  color: #334155;
  text-decoration: underline;
}

.cnblogs-news-empty {
  color: #7b849f;
  font-size: 0.8rem;
  padding: 4px 0;
}

/* --- GitHub Trending Page --- */
.github-trending-page .meta-index {
  margin-top: 12px;
}

.github-trending-page-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.github-trending-page-actions .back-link i {
  font-size: 0.85rem;
}

.github-trending-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.github-trending-switch-btn {
  border: 1px solid #d6defe;
  background: #ffffff;
  color: #4a5db3;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.github-trending-switch-btn.is-active {
  border-color: #b9c8ff;
  background: #eef2ff;
  color: #2e43a0;
}

.github-trending-full-list {
  display: grid;
  gap: 10px;
}

.github-trending-full-item {
  display: block;
  text-decoration: none;
  border: 1px solid #e2e8ff;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px 14px;
}

.github-trending-full-item:hover {
  border-color: #cdd8ff;
  box-shadow: 0 10px 18px rgba(64, 82, 170, 0.1);
}

.github-trending-full-top {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.github-trending-rank {
  font-size: 0.8rem;
  color: #6b7280;
  background: #eef2ff;
  border: 1px solid #dbe4ff;
  border-radius: 999px;
  min-width: 34px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.github-trending-full-title {
  color: #2f3f7b;
  font-weight: 700;
  font-size: 0.95rem;
}

.github-trending-full-desc-wrap {
  margin-top: 8px;
}

.github-trending-full-desc {
  color: #5b678f;
  font-size: 0.88rem;
  line-height: 1.55;
}

.github-trending-full-desc-zh {
  margin: 0;
  color: #3b4a7f;
  font-weight: 600;
}

.github-trending-full-desc-en {
  margin: 4px 0 0;
  color: #8a93ad;
  font-size: 0.8rem;
  font-style: italic;
}

.github-trending-full-meta {
  margin-top: 10px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: #4b587a;
  font-size: 0.84rem;
}

.github-trending-full-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* --- Weather Widget --- */
#weather-widget {
  background: #ffffff;
  color: #2f3a4b;
  border: 1px solid #e6eaf0;
  box-shadow: none;
}

.tools-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.tools-search-input-wrap {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dbe4ff;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 12px;
  padding: 10px 12px;
  color: #6a7596;
  box-shadow: 0 10px 18px rgba(67, 86, 170, 0.08);
}

.tools-search-input-wrap:focus-within {
  border-color: #b9ccff;
  box-shadow: 0 0 0 4px rgba(105, 132, 235, 0.14);
}

.tools-search-input-wrap input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #243257;
  font-size: 0.92rem;
}

#tool-search-clear {
  border: 1px solid #d6e1ff;
  background: #f6f9ff;
  color: #3954b7;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 700;
}

#tool-search-clear:hover {
  background: #edf3ff;
}

.tools-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.tools-nav-panel {
  position: sticky;
  top: 96px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid #e5ecff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 14px 24px rgba(84, 103, 196, 0.08);
}

.tools-nav-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4f5f86;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.tool-category-nav {
  display: grid;
  gap: 8px;
}

.tool-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #4f5f86;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #f8faff;
  transition: all 0.2s ease;
}

.tool-nav-link:hover {
  border-color: #dbe5ff;
  background: #f2f6ff;
  transform: translateX(1px);
}

.tool-nav-link.is-active {
  color: #2d4fc2;
  border-color: #cdd9ff;
  background: linear-gradient(135deg, #edf2ff, #f7f9ff);
  box-shadow: 0 8px 14px rgba(84, 103, 196, 0.12);
}

.tool-nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  font-size: 0.88rem;
}

.tool-nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}

.tool-nav-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  background: #e6edff;
  color: #2f4db5;
  border: 1px solid #cfdcff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
}

.tool-nav-link.is-active .tool-nav-badge {
  background: #dbe6ff;
  border-color: #bed0ff;
}

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

.tool-group-section {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid #e8ecff;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(41, 58, 128, 0.08);
  padding: 14px;
}

.tool-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tool-group-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tool-group-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eef2ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-group-title-wrap h3 {
  font-size: 1.02rem;
  color: #243257;
}

.tool-group-count {
  color: #6d7898;
  font-size: 0.92rem;
  font-weight: 700;
}

.tool-row-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.tool-row-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-height: 74px;
  border: 1px solid #e7ebfa;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border-radius: 12px;
  padding: 10px;
  overflow: visible;
  z-index: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tool-row-card:hover {
  transform: translateY(-1px);
  border-color: #d3ddff;
  box-shadow: 0 10px 18px rgba(40, 60, 138, 0.12);
}

.tool-row-card.is-disabled {
  cursor: default;
}

.tool-row-logo-wrap {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.tool-row-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-row-logo.fallback {
  background: #eef2ff;
  color: #4f46e5;
}

.tool-row-main {
  min-width: 0;
}

.tool-row-main h4 {
  color: #162241;
  font-size: 0.95rem;
  line-height: 1.25;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-row-main p {
  color: #7380a2;
  font-size: 0.82rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-row-desc-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: #ffffff;
  border: 1px solid #dbe4ff;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(35, 56, 130, 0.16);
  color: #4b587a;
  font-size: 0.84rem;
  line-height: 1.55;
  padding: 10px 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 8;
}

.tool-row-card:hover,
.tool-row-card:focus-within {
  z-index: 20;
}

.tool-row-card:hover .tool-row-desc-pop,
.tool-row-card:focus-within .tool-row-desc-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 1200px) {
  .tool-row-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .tools-layout {
    grid-template-columns: 1fr;
  }

  .tools-search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  #tool-search-clear {
    width: 100%;
  }

  .tools-nav-panel {
    position: static;
  }

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

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

@media (max-width: 640px) {
  .tool-category-nav,
  .tool-row-grid {
    grid-template-columns: 1fr;
  }
}

.weather-update {
  text-align: right;
  font-size: 0.66rem;
  color: #7f90a8;
  margin-bottom: 4px;
}

.weather-today-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.weather-today-left {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.weather-today-icon {
  font-size: 1.5rem;
  color: #3b82f6;
  filter: none;
  flex-shrink: 0;
}

.weather-today-main {
  min-width: 0;
}

.weather-today-top {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.weather-today-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #3f5d87;
}

.weather-today-temp {
  font-size: 1.28rem;
  line-height: 1;
  font-weight: 700;
  color: #1f4f8e;
}

.weather-today-sub {
  margin-top: 0;
  font-size: 0.66rem;
  line-height: 1.15;
  color: #6f86a6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-city-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.weather-city-btn {
  border: 1px solid #d6e7ff;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  border-radius: 999px;
  color: #37639a;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px;
  transition: all 0.18s ease;
  box-shadow: 0 2px 7px rgba(50, 110, 189, 0.12);
}

.weather-city-btn:hover {
  transform: translateY(-1px);
  border-color: #b8d2fb;
  box-shadow: 0 5px 12px rgba(50, 110, 189, 0.16);
}

.weather-future-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  padding-top: 4px;
  border-top: 1px solid #e3edf9;
}

.future-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

.future-day-label {
  font-size: 0.64rem;
  font-weight: 600;
  color: #6f86a7;
  line-height: 1;
}

.future-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #4f77b0;
  transition: transform 0.2s ease, background-color 0.2s ease;
  cursor: default;
}

.future-icon-wrap i {
  font-size: 0.86rem;
}

.future-icon-wrap:hover,
.future-icon-wrap:focus-visible {
  background: rgba(97, 149, 223, 0.16);
  transform: translateY(-1px) scale(1.04);
  outline: none;
}

.future-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translate(-50%, 5px) scale(0.96);
  transform-origin: bottom center;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  background: #2f3b4d;
  color: #f4f7fb;
  font-size: 0.66rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(22, 30, 44, 0.22);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 6;
}

.future-pop::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 6px;
  height: 6px;
  background: #2f3b4d;
  transform: translateX(-50%) rotate(45deg);
}

.future-icon-wrap:hover .future-pop,
.future-icon-wrap:focus-visible .future-pop {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.future-day-range {
  font-size: 0.6rem;
  color: #7c93b2;
  line-height: 1;
}

.weather-city-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  isolation: isolate;
}

.weather-city-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 31, 0.48);
  backdrop-filter: blur(3px);
}

.weather-city-modal-panel {
  position: relative;
  width: min(92vw, 360px);
  margin: 16vh auto 0;
  border-radius: 16px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 14px;
  box-shadow: 0 18px 40px rgba(20, 63, 107, 0.24);
  animation: weather-modal-in 0.22s ease;
}

@keyframes weather-modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.weather-city-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.weather-city-modal-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #153b5a;
}

.weather-city-modal-close {
  border: 0;
  background: transparent;
  color: #6d83a5;
  font-size: 0.95rem;
}

.weather-city-modal-tip {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: #62809d;
}

.weather-city-input {
  width: 100%;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.92rem;
  color: #0f3b5d;
  outline: none;
}

.weather-city-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
}

.weather-city-modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.weather-city-cancel,
.weather-city-confirm {
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.weather-city-cancel {
  background: #ffffff;
  color: #587795;
}

.weather-city-confirm {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-color: #2563eb;
  color: #ffffff;
}

.teaching-page .meta-header {
  margin: 20px 0 10px;
}

.teaching-page .meta-header-inner {
  justify-content: flex-end;
}

.teaching-page .meta-header-right {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(31, 42, 68, 0.08);
  box-shadow: 0 8px 26px rgba(24, 38, 66, 0.08);
  padding: 9px 16px;
}

.teaching-page .header-title {
  letter-spacing: 0.02em;
  color: #1f2a44;
}

.teaching-index {
  margin-top: 1.35rem;
  margin-bottom: 2.8rem;
}

.teaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 320px));
  justify-content: center;
  gap: 1.3rem;
}

.teaching-card {
  background: #ffffff;
  border: 1px solid #e9edf3;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(22, 32, 52, 0.06);
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.teaching-card:hover {
  transform: translateY(-4px);
  border-color: #d9e2ec;
  box-shadow: 0 14px 30px rgba(22, 32, 52, 0.1);
}

.teaching-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.teaching-card-cover-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f2f5f9;
}

.teaching-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.teaching-card-body {
  padding: 1rem 1rem 1.05rem;
}

.teaching-card-title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  color: #1f2937;
}

.teaching-card-summary {
  margin: 0.55rem 0 0.9rem;
  color: #4b5563;
  font-size: 0.91rem;
  line-height: 1.62;
  min-height: 3.2em;
}

.teaching-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6b7280;
  font-size: 0.84rem;
}

.teaching-card-more {
  color: #1f4fa8;
  font-weight: 600;
}

@media (max-width: 640px) {
  .teaching-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.teaching-course-main {
  margin-top: 1.25rem;
  margin-bottom: 3rem;
}

.teaching-course-shell {
  max-width: 1160px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
  padding: 30px 28px 34px;
}

.teaching-course-title {
  color: #0f172a;
  margin: 4px 0 8px;
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  line-height: 1.22;
  letter-spacing: 0.01em;
  font-weight: 700;
}

.teaching-course-subtitle {
  color: #475569;
  margin: 0 0 24px;
  max-width: 72ch;
  line-height: 1.7;
  font-size: 0.97rem;
}

.teaching-course-section {
  margin-top: 28px;
}

.teaching-course-section-title {
  color: #1e293b;
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  padding-left: 10px;
  border-left: 4px solid #cbd5e1;
}

.teaching-course-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.teaching-doc-card,
.teaching-tool-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e6ebf2;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  padding: 16px;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 185px;
}

.teaching-doc-card:hover,
.teaching-tool-card:hover {
  transform: translateY(-3px);
  border-color: #d3dce8;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.teaching-doc-card h3,
.teaching-tool-card h3 {
  color: #0f172a;
  margin: 0 0 10px;
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.45;
}

.teaching-doc-card p,
.teaching-tool-card p {
  color: #475569;
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.7;
  flex-grow: 1;
}

.teaching-course-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid #d8e1ec;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.teaching-tool-card .teaching-course-btn {
  background: #f1f5f9;
}

.teaching-course-btn:hover {
  background: #eef2f7;
  border-color: #c4d0df;
  color: #0f172a;
}

@media (max-width: 1024px) {
  .teaching-course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .teaching-course-shell {
    padding: 20px 14px 22px;
    border-radius: 12px;
  }

  .teaching-course-title {
    font-size: 1.45rem;
  }

  .teaching-course-subtitle {
    font-size: 0.92rem;
    margin-bottom: 20px;
  }

  .teaching-course-section-title {
    font-size: 1.06rem;
    margin-bottom: 12px;
  }

  .teaching-course-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ===== PWA 更新提示 ===== */
.pwa-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background-color: #333;
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 15px;
  transform: translateY(200%);
  transition: transform 0.4s ease-in-out;
  pointer-events: none;
}

.pwa-toast.show {
  transform: translateY(0);
  pointer-events: auto;
}

.pwa-toast-message {
  margin: 0;
  font-size: 0.94rem;
}

.pwa-toast-button {
  background-color: #4A90E2;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
}

.pwa-toast-button:hover {
  background-color: #357ABD;
}
