@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* ===== 基础重置 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Mono', 'Courier New', Courier, monospace;
  background-color: #172623;
  color: #d4c4a8;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 公告条 ===== */
.announce-bar {
  background: #5cc6b0;
  color: #172623;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 顶部导航 ===== */
.site-header {
  background: #172623;
  border-bottom: 2px solid #5cc6b0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header nav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 56px;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: stretch;
  list-style: none;
  gap: 0;
  flex: 1;
}

.nav-right {
  justify-content: flex-end;
}

.nav-left > li > a,
.nav-right > li > a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  min-height: 56px;
  color: #d4c4a8;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.2s ease-out, background 0.2s ease-out;
}

.nav-left > li > a:hover,
.nav-right > li > a:hover {
  color: #5cc6b0;
  background: rgba(92, 198, 176, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  flex-shrink: 0;
}

.brand-link {
  color: #5cc6b0;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: opacity 0.2s ease-out;
}

.brand-link:hover {
  opacity: 0.8;
}

/* ===== 粘性锚点条 ===== */
.sticky-anchor {
  background: #1e2e2a;
  border-bottom: 1px solid rgba(92, 198, 176, 0.25);
  position: sticky;
  top: 56px;
  z-index: 90;
}

.anchor-list {
  display: flex;
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  gap: 0;
}

.anchor-list > li > a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 40px;
  color: #d4c4a8;
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  transition: color 0.2s ease-out;
}

.anchor-list > li > a:hover {
  color: #5cc6b0;
}

/* ===== 主容器 ===== */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== 眉题 ===== */
.eyebrow {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #5cc6b0;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ===== HERO（首页） ===== */
.hero-section {
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  padding: 60px 0 48px;
}

.hero-article {
  width: 100%;
  text-align: right;
}

.hero-h1 {
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 700;
  color: #d4c4a8;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 0.9rem;
  color: rgba(212, 196, 168, 0.7);
  max-width: 520px;
  margin-left: auto;
  line-height: 1.7;
}

/* ===== TOPIC HERO ===== */
.topic-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid rgba(92, 198, 176, 0.2);
  margin-bottom: 40px;
}

.topic-hero-article h1,
.tag-hero-article h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #d4c4a8;
  line-height: 1.2;
  margin-bottom: 12px;
}

.topic-sub {
  font-size: 0.88rem;
  color: rgba(212, 196, 168, 0.65);
  max-width: 600px;
  line-height: 1.7;
}

.tag-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid rgba(92, 198, 176, 0.2);
  margin-bottom: 40px;
}

/* ===== 内容+侧边栏布局 ===== */
.content-section {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  padding: 40px 0;
}

.article-section {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  padding: 40px 0;
}

.privacy-section,
.about-section,
.default-section {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  padding: 40px 0;
}

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

/* ===== 侧边栏 ===== */
aside.sidebar {
  min-width: 0;
}

.sidebar-block {
  background: #1e2e2a;
  border: 1px solid rgba(92, 198, 176, 0.2);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #d4c4a8;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}

.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-list > li > a {
  display: block;
  padding: 8px 0;
  color: rgba(212, 196, 168, 0.8);
  text-decoration: none;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(92, 198, 176, 0.1);
  transition: color 0.2s ease-out, padding-left 0.2s ease-out;
}

.sidebar-list > li:last-child > a {
  border-bottom: none;
}

.sidebar-list > li > a:hover {
  color: #5cc6b0;
  padding-left: 6px;
}

/* ===== 标签云 ===== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(92, 198, 176, 0.12);
  border: 1px solid rgba(92, 198, 176, 0.3);
  border-radius: 4px;
  color: #5cc6b0;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: background 0.2s ease-out, color 0.2s ease-out;
}

.tag-cloud a:hover {
  background: rgba(92, 198, 176, 0.25);
  color: #d4c4a8;
}

/* ===== 卡片网格 ===== */
.cards-section {
  padding: 40px 0;
  border-top: 1px solid rgba(92, 198, 176, 0.15);
}

.cards-section > .eyebrow {
  margin-bottom: 4px;
}

.cards-section > h2 {
  font-size: 1.2rem;
  color: #d4c4a8;
  margin-bottom: 24px;
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  background: #d4c4a8;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s ease-out, box-shadow 0.22s ease-out;
  animation: cardFadeIn 0.4s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.07s);
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
}

.card-inner {
  padding: 20px;
}

.card-eyebrow {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #5cc6b0;
  margin-bottom: 8px;
}

.card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.card h3 a {
  color: #172623;
  text-decoration: none;
  transition: color 0.2s ease-out;
}

.card h3 a:hover {
  color: #3a9e8c;
}

.card-desc {
  font-size: 0.76rem;
  color: rgba(23, 38, 35, 0.7);
  line-height: 1.6;
  margin-bottom: 10px;
}

.card-date {
  font-size: 0.68rem;
  color: rgba(23, 38, 35, 0.55);
}

/* ===== 表格（topic 子页列表） ===== */
.topic-table-section {
  margin-bottom: 40px;
}

.topic-table-section > .eyebrow { margin-bottom: 4px; }

.topic-table-section > h2 {
  font-size: 1.2rem;
  color: #d4c4a8;
  font-weight: 700;
  margin-bottom: 20px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid rgba(92, 198, 176, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

thead tr {
  background: rgba(92, 198, 176, 0.12);
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: #5cc6b0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(92, 198, 176, 0.2);
}

tbody tr {
  border-bottom: 1px solid rgba(92, 198, 176, 0.1);
  transition: background 0.15s ease-out;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(92, 198, 176, 0.06);
}

tbody td {
  padding: 12px 16px;
  color: #d4c4a8;
  vertical-align: top;
}

tbody td a {
  color: #5cc6b0;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease-out;
}

tbody td a:hover {
  color: #d4c4a8;
}

.td-desc {
  color: rgba(212, 196, 168, 0.65);
  font-size: 0.76rem;
  max-width: 300px;
}

.td-date {
  white-space: nowrap;
  font-size: 0.72rem;
  color: rgba(212, 196, 168, 0.5);
}

/* ===== 正文 Prose ===== */
.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: #d4c4a8;
}

.prose h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #d4c4a8;
  margin: 2em 0 0.6em;
  letter-spacing: 0.01em;
  border-left: 3px solid #5cc6b0;
  padding-left: 12px;
}

.prose h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #d4c4a8;
  margin: 1.6em 0 0.5em;
}

.prose p {
  margin-bottom: 1.2em;
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose a {
  color: #5cc6b0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease-out;
}

.prose a:hover {
  color: #d4c4a8;
}

.prose strong {
  color: #d4c4a8;
  font-weight: 700;
}

.prose blockquote {
  border-left: 3px solid #5cc6b0;
  padding: 12px 16px;
  margin: 1.5em 0;
  background: rgba(92, 198, 176, 0.07);
  border-radius: 0 4px 4px 0;
  font-style: normal;
}

.prose code {
  background: rgba(92, 198, 176, 0.12);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.88em;
  color: #5cc6b0;
}

.prose pre {
  background: #0e1a18;
  padding: 16px;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.2em;
}

.prose table {
  margin-bottom: 1.2em;
}

/* ===== 文章页特有 ===== */
.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(92, 198, 176, 0.15);
}

.article-header h1 {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: #d4c4a8;
  line-height: 1.25;
  margin-bottom: 12px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.72rem;
  color: rgba(212, 196, 168, 0.55);
  margin-top: 10px;
}

.article-meta time {
  color: rgba(212, 196, 168, 0.55);
}

.breadcrumb {
  font-size: 0.72rem;
  color: rgba(212, 196, 168, 0.5);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb a {
  color: #5cc6b0;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.article-footer-nav {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(92, 198, 176, 0.15);
}

.btn-back {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(92, 198, 176, 0.12);
  border: 1px solid rgba(92, 198, 176, 0.35);
  border-radius: 4px;
  color: #5cc6b0;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 0.2s ease-out, color 0.2s ease-out;
  min-height: 40px;
  line-height: 1.2;
}

.btn-back:hover {
  background: rgba(92, 198, 176, 0.22);
  color: #d4c4a8;
}

/* ===== 相关文章区 ===== */
.related-section {
  padding: 40px 0;
  border-top: 1px solid rgba(92, 198, 176, 0.15);
}

.related-section > .eyebrow { margin-bottom: 4px; }

.related-section > h2 {
  font-size: 1.1rem;
  color: #d4c4a8;
  font-weight: 700;
  margin-bottom: 20px;
}

/* ===== 标签页文章列表 ===== */
.tag-articles {
  margin-top: 32px;
}

.tag-articles > .eyebrow { margin-bottom: 4px; }

.tag-articles > h2 {
  font-size: 1.1rem;
  color: #d4c4a8;
  font-weight: 700;
  margin-bottom: 16px;
}

.article-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.article-list-item {
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  border-bottom: 1px solid rgba(92, 198, 176, 0.1);
}

.article-list-item:last-child {
  border-bottom: none;
}

.article-list-link {
  color: #5cc6b0;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
  transition: color 0.2s ease-out;
}

.article-list-link:hover {
  color: #d4c4a8;
}

.article-list-desc {
  font-size: 0.76rem;
  color: rgba(212, 196, 168, 0.6);
  line-height: 1.5;
}

/* ===== About / Privacy ===== */
.about-body h1,
.privacy-body h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: #d4c4a8;
  margin-bottom: 16px;
  line-height: 1.2;
}

/* ===== 页脚 ===== */
footer {
  background: #0e1a18;
  border-top: 2px solid #5cc6b0;
  text-align: center;
  padding: 32px 16px 24px;
  margin-top: 60px;
}

.footer-brand {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 700;
  color: rgba(212, 196, 168, 0.15);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 12px;
  user-select: none;
}

footer small {
  display: block;
  font-size: 0.7rem;
  color: rgba(212, 196, 168, 0.45);
  letter-spacing: 0.04em;
}

footer small a {
  color: rgba(92, 198, 176, 0.7);
  text-decoration: none;
}

footer small a:hover {
  color: #5cc6b0;
}

/* ===== 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: cardFadeIn 0.4s ease-out both;
  }

  .sidebar-block {
    animation: cardFadeIn 0.5s ease-out both;
  }

  .prose h2,
  .prose h3 {
    transition: border-color 0.2s ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .sidebar-block {
    animation: none;
  }
  * {
    transition: none !important;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .content-section,
  .article-section,
  .privacy-section,
  .about-section,
  .default-section {
    grid-template-columns: 1fr;
  }

  aside.sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .sidebar-block {
    margin-bottom: 0;
  }
}

@media (max-width: 680px) {
  .site-header nav {
    flex-wrap: wrap;
    min-height: auto;
    padding: 0;
  }

  .nav-left,
  .nav-right {
    flex: none;
    width: 100%;
    flex-wrap: wrap;
    background: #0e1a18;
    border-top: 1px solid rgba(92, 198, 176, 0.15);
  }

  .nav-right {
    justify-content: flex-start;
    order: 3;
  }

  .nav-left > li > a,
  .nav-right > li > a {
    min-height: 44px;
    padding: 0 10px;
    font-size: 0.65rem;
  }

  .brand {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    order: 1;
  }

  .nav-left { order: 2; }

  .brand-link {
    font-size: 0.9rem;
  }

  .hero-section {
    min-height: auto;
    padding: 40px 0 32px;
  }

  .hero-article {
    text-align: left;
  }

  .hero-sub {
    margin-left: 0;
    max-width: 100%;
  }

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

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

  .table-wrap {
    font-size: 0.75rem;
  }

  .td-desc {
    display: none;
  }

  .sticky-anchor {
    top: auto;
    position: relative;
  }

  .anchor-list {
    flex-wrap: wrap;
  }
}

@media (max-width: 400px) {
  .wrap {
    padding: 0 12px;
  }

  .hero-h1 {
    font-size: 1.8rem;
  }
}
