/* ============================================================
   月见 · Tsukimi — 暗夜赏月主题
   日月逝矣，岁不我与
   移动端全面适配版
   ============================================================ */

/* ----- Reset & Base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  transition: background 0.6s ease, color 0.6s ease;
  position: relative;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.25s ease;
}
a:hover {
  opacity: 0.8;
  text-shadow: 0 0 12px var(--accent-glow);
}

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

/* ----- Starfield Canvas ----- */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  transition: opacity 0.6s ease;
}
body.light-mode #starfield { opacity: 0; }

/* ----- Moon Indicator ----- */
.moon-indicator {
  position: fixed;
  top: 24px; right: 80px;
  width: 48px; height: 48px;
  cursor: pointer;
  z-index: 1000;
  border-radius: 50%;
  transition: transform 0.3s ease;
}
.moon-indicator:hover { transform: scale(1.15); }
.moon-svg {
  width: 100%; height: 100%;
  filter: drop-shadow(0 0 16px var(--accent-glow));
  transition: filter 0.6s ease;
}
.moon-body { fill: #f5e6c8; transition: fill 0.6s ease; }
.moon-shadow { fill: var(--bg); transition: fill 0.6s ease; }
.moon-crater { fill: rgba(180, 160, 130, 0.3); }
body.light-mode .moon-body { fill: #e8a020; }
body.light-mode .moon-shadow { fill: #f5f0e8; }
body.light-mode .moon-svg { filter: drop-shadow(0 0 8px rgba(232, 160, 32, 0.2)); }

/* ----- Navigation ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background 0.6s ease, border-color 0.6s ease;
}
.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo { font-size: 1.5rem; }
.nav-title {
  font-family: "Noto Serif SC", "STSong", serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.nav-links { display: flex; gap: 8px; }
.nav-link {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-link:hover {
  color: var(--accent);
  background: var(--border);
  text-shadow: none;
  opacity: 1;
}
.nav-link:active {
  transform: scale(0.95);
}

/* Hamburger Button */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px; height: 38px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 101;
  margin-left: 12px;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.nav-overlay.active {
  display: block;
  opacity: 1;
}

.mode-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  margin-left: 12px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.mode-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.mode-toggle:active {
  transform: scale(0.9);
}

/* ----- Main Layout ----- */
.main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ----- Hero Section ----- */
.hero {
  text-align: center;
  padding: 80px 0 60px;
  position: relative;
}
.hero-title {
  font-family: "Noto Serif SC", "STSong", serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  animation: heroFadeIn 1.2s ease;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.15em;
  animation: heroFadeIn 1.2s ease 0.2s both;
}
.hero-motto {
  margin-top: 32px;
  animation: heroFadeIn 1.2s ease 0.4s both;
}
.motto-text {
  display: inline-block;
  padding: 8px 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

/* ----- Post Cards ----- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.35s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.post-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow), 0 4px 24px rgba(0,0,0,0.3);
  transform: translateY(-3px);
}
.post-card:active {
  transform: scale(0.985);
}
.post-card-inner {
  display: flex;
  gap: 0;
}
.post-cover {
  flex-shrink: 0;
  width: 200px;
  overflow: hidden;
}
.post-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.post-card:hover .post-cover img { transform: scale(1.05); }

/* Default Cover Placeholder */
.post-cover-default {
  background: linear-gradient(135deg, #141829 0%, #1a1f35 40%, #0d1117 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}
.cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}
.post-card:hover .cover-placeholder { opacity: 0.8; }
.cover-icon { font-size: 2.2rem; }
.cover-label {
  font-family: "Noto Serif SC", serif;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.15em;
}
.post-body {
  padding: 24px 28px;
  flex: 1;
  min-width: 0;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.post-date { font-family: "JetBrains Mono", monospace; }
.post-cat {
  color: var(--accent);
  opacity: 0.7;
  font-size: 0.8rem;
}
.post-cat:hover { opacity: 1; }
.post-cat-sep { margin: 0 3px; color: var(--text-muted); }
.post-dot { color: var(--text-muted); }
.post-title {
  font-family: "Noto Serif SC", serif;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 8px;
}
.post-title a {
  color: var(--text);
  transition: color 0.3s ease;
}
.post-title a:hover {
  color: var(--accent);
  text-shadow: none;
  opacity: 1;
}

/* AI Badge */
.ai-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.15), rgba(180, 140, 100, 0.08));
  border: 1px solid rgba(212, 165, 116, 0.3);
  color: var(--accent);
  vertical-align: middle;
  margin-left: 10px;
  white-space: nowrap;
}
.ai-badge-post {
  margin-left: 6px;
  margin-right: 0;
}
.post-excerpt {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.post-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.stat-item { display: flex; align-items: center; gap: 3px; }
.stat-icon { font-size: 0.85rem; }
.stat-dot { color: var(--text-muted); }

/* ----- Pagination ----- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 48px;
  padding: 24px 0;
}
.page-link {
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.page-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
  text-shadow: none;
}
.page-link:active {
  transform: scale(0.95);
}
.page-info {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ----- Article Page ----- */
.article { padding: 20px 0; }
.article-header { margin-bottom: 40px; }
.article-title {
  font-family: "Noto Serif SC", serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 16px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.article-date { font-family: "JetBrains Mono", monospace; }
.article-dot { color: var(--text-muted); }
.article-cat { color: var(--accent); opacity: 0.7; }
.article-cat:hover { opacity: 1; }
.article-cat-sep { margin: 0 2px; opacity: 0.3; }
.article-read-time { font-size: 0.82rem; }
.article-cover {
  margin-top: 28px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.article-cover img { width: 100%; }

/* Article Body Typography */
.article-body {
  font-family: "Noto Serif SC", "STSong", "PingFang SC", serif;
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
}
.article-body p { margin-bottom: 1.2em; }
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: "Noto Serif SC", serif;
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.4;
  color: var(--accent);
}
.article-body h1 { font-size: 1.8rem; }
.article-body h2 { font-size: 1.5rem; }
.article-body h3 { font-size: 1.25rem; }
.article-body h4 { font-size: 1.1rem; }

.article-body ul, .article-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}
.article-body li { margin-bottom: 0.4em; }
.article-body blockquote {
  margin: 1.5em 0;
  padding: 16px 24px;
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}
.article-body blockquote p { margin-bottom: 0; }
.article-body a {
  border-bottom: 1px dashed var(--accent);
  padding-bottom: 1px;
}
.article-body a:hover { border-bottom-style: solid; text-shadow: none; }
.article-body img {
  border-radius: 8px;
  margin: 1.2em 0;
  border: 1px solid var(--border);
}
.article-body hr {
  border: none;
  margin: 2.5em 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Code Blocks */
.article-body code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.88em;
  background: rgba(212, 165, 116, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  color: #e8c88a;
  word-break: break-all;
}
.article-body pre {
  margin: 1.5em 0;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: #0d1117 !important;
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.article-body pre::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: #e6edf3;
  font-size: 0.85em;
  line-height: 1.7;
  white-space: pre;
  word-break: normal;
}

/* Tables — scroll wrapper */
.article-body .table-wrapper,
.article-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.article-body table {
  margin: 1.2em 0;
  border-collapse: collapse;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: table;
  min-width: 100%;
}
.article-body th, .article-body td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.article-body th {
  background: var(--bg-card);
  font-weight: 600;
  color: var(--accent);
}
.article-body tr:last-child td { border-bottom: none; }

/* Article Footer */
.article-footer { margin-top: 60px; padding-top: 32px; border-top: 1px solid var(--border); }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.article-tag {
  display: inline-block;
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.article-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card);
  text-shadow: none;
  opacity: 1;
}
.article-tag:active {
  transform: scale(0.95);
}
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.article-nav-link {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.article-nav-link:hover {
  border-color: var(--accent);
  background: var(--bg-card);
  text-shadow: none;
  opacity: 1;
}
.article-nav-link:active {
  transform: scale(0.97);
}
.article-nav-link.next { text-align: right; margin-left: auto; }
.nav-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.nav-title {
  font-size: 0.9rem;
  color: var(--text);
}

/* ----- Category Grid ----- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s ease;
  background: var(--bg-card);
  -webkit-tap-highlight-color: transparent;
}
.category-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  text-shadow: none;
  opacity: 1;
}
.category-card:active {
  transform: scale(0.97);
}
.category-name { font-weight: 500; color: var(--text); }
.category-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

/* ----- Tag Cloud ----- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 30px 0;
}
.tag-cloud-item {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  -webkit-tap-highlight-color: transparent;
  min-height: 36px;
  align-items: center;
}
.tag-cloud-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 16px var(--accent-glow);
  text-shadow: none;
  opacity: 1;
}
.tag-cloud-item:active {
  transform: scale(0.95);
}
.tag-cloud-item sup {
  font-size: 0.65em;
  color: var(--accent);
  opacity: 0.6;
}

/* ----- Archives ----- */
.archive-year-group { margin-bottom: 32px; }
.archive-year {
  font-family: "Noto Serif SC", serif;
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.archive-post {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.25s ease;
}
.archive-post:hover {
  background: var(--bg-card);
  text-shadow: none;
  opacity: 1;
}
.archive-date {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 50px;
}
.archive-title {
  color: var(--text);
  font-size: 0.95rem;
}

/* ----- Page Section ----- */
.page-section { padding: 20px 0; }
.page-title {
  font-family: "Noto Serif SC", serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}
.page-desc {
  color: var(--text-muted);
  margin-bottom: 32px;
}
.page-content {
  max-width: 760px;
}

/* ----- Empty State ----- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-text { color: var(--text-muted); font-size: 1rem; }

/* ----- Footer ----- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}
.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.footer-powered { font-size: 0.8rem; color: var(--text-muted); opacity: 0.6; }
.footer-beian { font-size: 0.75rem; color: var(--text-muted); opacity: 0.4; margin-top: 6px; }

/* ----- Constellation Moments ----- */
.moment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 48px;
  justify-content: center;
}

/* Constellation container */
.constellation {
  position: relative;
  padding: 60px 0 80px;
}

/* Core orb at the top */
.constellation-core {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 40px;
  margin-bottom: 10px;
}
.core-glow {
  position: absolute;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,165,116,0.3) 0%, transparent 70%);
  animation: corePulse 3s ease-in-out infinite;
}
.core-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent), 0 0 40px var(--accent-glow);
  z-index: 1;
}
@keyframes corePulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.5); opacity: 1; }
}

/* Terminal glow at bottom */
.constellation-terminal {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.constellation-terminal::after {
  content: '';
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  box-shadow: 0 0 15px var(--accent-glow);
}

/* Timeline structure */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Timeline item */
.timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 800px;
  padding: 8px 0;
}

/* Connector line between stars */
.timeline-connector {
  width: 2px;
  height: 16px;
  background: linear-gradient(to bottom, rgba(212,165,116,0.4), rgba(212,165,116,0.1));
}

/* Star node */
.timeline-star {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  z-index: 2;
}
.star-glow {
  position: absolute;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,165,116,0.25) 0%, transparent 70%);
  animation: starTwinkle 2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.3s);
}
.star-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent-glow);
  transition: all 0.3s ease;
}
.timeline-item:hover .star-dot {
  width: 10px; height: 10px;
  box-shadow: 0 0 14px var(--accent), 0 0 28px var(--accent-glow);
}
.timeline-item:hover .star-glow {
  background: radial-gradient(circle, rgba(212,165,116,0.4) 0%, transparent 70%);
}
@keyframes starTwinkle {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Timeline card */
.timeline-card {
  width: 100%;
  max-width: 540px;
  padding: 20px 24px;
  margin: 8px 0 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: all 0.35s ease;
  position: relative;
}
.timeline-card::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--border);
}
.timeline-card::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--bg-card);
}
.timeline-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow), 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}
.timeline-card:active {
  transform: scale(0.98);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.card-author {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.88rem;
}
.card-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-body {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 10px;
  word-break: break-word;
}
.card-body a { color: var(--accent); border-bottom: 1px dashed var(--accent); }
.card-body a:hover { border-bottom-style: solid; text-shadow: none; }
.card-body p { margin-bottom: 0.4em; }

.card-media {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.card-img {
  max-width: 240px;
  max-height: 240px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.card-img:hover {
  transform: scale(1.03);
  border-color: var(--accent);
}

.card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.card-stats .stat {
  display: flex;
  align-items: center;
  gap: 4px;
}
.footer-sep { margin: 0 6px; opacity: 0.4; }
.footer a { color: var(--accent); opacity: 0.7; }
.footer a:hover { opacity: 1; text-shadow: none; }

/* ============================================================
   RESPONSIVE — 平板 (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  /* Navigation — show hamburger */
  .nav-inner { padding: 0 16px; height: 56px; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: -280px;
    width: 260px;
    height: 100vh;
    flex-direction: column;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    padding: 80px 24px 40px;
    gap: 4px;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow-y: auto;
  }
  .nav-links.active { right: 0; }
  .nav-link {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 1rem;
    width: 100%;
  }

  /* Moon indicator */
  .moon-indicator { top: 10px; right: 64px; width: 36px; height: 36px; }

  /* Main */
  .main { padding: 28px 16px 60px; }

  /* Hero */
  .hero { padding: 40px 0 32px; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-motto { margin-top: 24px; }

  /* Post cards */
  .post-list { gap: 16px; }
  .post-card-inner { flex-direction: column; }
  .post-cover { width: 100%; max-height: 180px; }
  .post-cover-default { min-height: 100px; }
  .post-body { padding: 16px 20px; }
  .post-title { font-size: 1.1rem; }
  .post-excerpt { font-size: 0.88rem; -webkit-line-clamp: 3; }

  /* Article */
  .article-title { font-size: 1.6rem; }
  .article-body { font-size: 0.98rem; line-height: 1.9; }
  .article-body h1 { font-size: 1.5rem; }
  .article-body h2 { font-size: 1.3rem; }
  .article-body h3 { font-size: 1.15rem; }
  .article-body pre { padding: 16px 18px; }
  .article-body pre code { font-size: 0.8em; }
  .article-body blockquote { padding: 12px 18px; }
  .article-cover { margin-top: 20px; }
  .article-header { margin-bottom: 28px; }
  .article-nav { grid-template-columns: 1fr; }

  /* Category */
  .category-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* Page */
  .page-title { font-size: 1.5rem; }

  /* Archives */
  .archive-year { font-size: 1.3rem; }
  .archive-post { padding: 10px 8px; gap: 10px; }
  .archive-date { font-size: 0.78rem; min-width: 42px; }
  .archive-title { font-size: 0.88rem; }

  /* Pagination */
  .pagination { gap: 12px; margin-top: 36px; }
  .page-link { padding: 8px 18px; font-size: 0.85rem; }

  /* Moments */
  .constellation { padding: 40px 0 60px; }
  .timeline-card { max-width: 100%; padding: 16px 18px; }
  .timeline-item { padding: 6px 0; }
  .card-img { max-width: 180px; max-height: 180px; }
  .moment-tags { margin-bottom: 32px; padding: 0 8px; gap: 6px; }

  /* Footer */
  .footer { padding: 24px 16px; }
}

/* ============================================================
   RESPONSIVE — 手机 (≤480px)
   ============================================================ */
@media (max-width: 480px) {
  .nav-inner { padding: 0 12px; height: 52px; }
  .nav-brand { gap: 6px; }
  .nav-logo { font-size: 1.3rem; }
  .nav-title { font-size: 1rem; }
  .mode-toggle { width: 34px; height: 34px; font-size: 1rem; margin-left: 8px; }

  .moon-indicator { top: 8px; right: 58px; width: 32px; height: 32px; }

  .main { padding: 20px 14px 48px; }

  .hero { padding: 32px 0 24px; }
  .hero-title { font-size: 1.6rem; letter-spacing: 0.04em; }
  .hero-subtitle { font-size: 0.85rem; letter-spacing: 0.08em; }
  .motto-text { font-size: 0.8rem; padding: 6px 18px; }

  .post-list { gap: 12px; }
  .post-cover { max-height: 160px; }
  .post-body { padding: 14px 16px; }
  .post-title { font-size: 1rem; }
  .post-meta { font-size: 0.75rem; gap: 6px; }
  .post-excerpt { font-size: 0.83rem; -webkit-line-clamp: 3; }
  .post-stats { font-size: 0.75rem; gap: 4px; }
  .ai-badge { font-size: 0.6rem; padding: 1px 8px; margin-left: 6px; }

  .article-title { font-size: 1.35rem; }
  .article-body { font-size: 0.93rem; line-height: 1.85; }
  .article-body h1 { font-size: 1.3rem; }
  .article-body h2 { font-size: 1.15rem; }
  .article-body h3 { font-size: 1.05rem; }
  .article-body pre { padding: 12px 14px; margin: 1em 0; }
  .article-body pre code { font-size: 0.75em; }
  .article-body blockquote { padding: 10px 14px; margin: 1em 0; }
  .article-meta { font-size: 0.8rem; gap: 6px; }

  .category-grid { grid-template-columns: 1fr; }
  .category-card { padding: 14px 16px; }

  .tag-cloud { gap: 8px; padding: 20px 0; }
  .tag-cloud-item { padding: 5px 12px; font-size: 0.85rem; }

  .page-title { font-size: 1.3rem; }
  .page-section { padding: 10px 0; }

  .pagination { gap: 10px; margin-top: 28px; }
  .page-link { padding: 6px 14px; font-size: 0.8rem; }

  .timeline-card { padding: 14px 16px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .card-body { font-size: 0.85rem; line-height: 1.65; }
  .card-img { max-width: 140px; max-height: 140px; }
  .card-stats { font-size: 0.72rem; gap: 8px; }

  .archive-post { flex-direction: column; gap: 2px; padding: 8px 6px; }
  .archive-date { font-size: 0.72rem; }
  .archive-title { font-size: 0.85rem; }

  .article-footer { margin-top: 40px; padding-top: 24px; }
  .article-tags { gap: 6px; margin-bottom: 24px; }

  .footer-text { font-size: 0.78rem; }
  .footer-beian { font-size: 0.7rem; }
}

/* ============================================================
   RESPONSIVE — 小屏手机 (≤375px, iPhone SE etc.)
   ============================================================ */
@media (max-width: 375px) {
  .nav-inner { padding: 0 10px; height: 48px; }
  .nav-logo { font-size: 1.2rem; }
  .nav-title { font-size: 0.9rem; }
  .mode-toggle { width: 30px; height: 30px; font-size: 0.9rem; margin-left: 6px; }
  .nav-toggle { width: 34px; height: 34px; }
  .moon-indicator { top: 6px; right: 52px; width: 28px; height: 28px; }

  .main { padding: 16px 10px 40px; }

  .hero { padding: 24px 0 20px; }
  .hero-title { font-size: 1.4rem; }
  .hero-subtitle { font-size: 0.78rem; }

  .post-body { padding: 12px 14px; }
  .post-title { font-size: 0.95rem; }
  .post-meta { font-size: 0.7rem; }
  .post-excerpt { font-size: 0.8rem; }

  .article-title { font-size: 1.2rem; }
  .article-body { font-size: 0.88rem; line-height: 1.8; }
  .article-body h1 { font-size: 1.2rem; }
  .article-body h2 { font-size: 1.08rem; }
  .article-body pre { padding: 10px 12px; }
  .article-body pre code { font-size: 0.72em; }

  .timeline-card { padding: 12px 14px; }
  .card-body { font-size: 0.82rem; }
  .card-img { max-width: 120px; max-height: 120px; }

  .page-link { padding: 5px 10px; font-size: 0.75rem; }
  .page-info { font-size: 0.75rem; }
}

/* ----- Scrollbar (Webkit) ----- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ----- Selection ----- */
::selection {
  background: rgba(212, 165, 116, 0.25);
  color: var(--text);
}

/* ----- Print ----- */
@media print {
  .nav, .footer, .moon-indicator, #starfield, .mode-toggle, .nav-toggle, .nav-overlay { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .article-body { font-size: 12pt; }
}
