:root {
  /* 基礎設定 */
  --width: 720px;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-secondary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-scale: 1em;
  
  /* 📖 閱讀友善莫蘭迪（Light） */
  --background-color: #faf9f7;   /* 更乾淨的紙感白 */
  --heading-color: #3f3f3f;      /* 深暖灰（標題） */
  --text-color: #55514d;         /* 正文灰（對比↑） */
  --blockquote-color: #5f5b57;

  --link-color: #6f9a8f;         /* 稍微加深的灰綠 */
  --visited-color: #8e7f8a;

  /* Timeline */
  --timeline-line: #cfcac4;      /* 線條清楚但不刺眼 */
  --timeline-date: #7e7a75;

  /* 節點色（略微加深） */
  --icon-gray: #7e7a75;
  --icon-blue: #688f8d;
  --icon-green: #8fa28a;
  --icon-purple: #9d8fa0;
  --icon-red: #b08b8b;
  --icon-orange: #c9a28a;
  --icon-teal: #6f9a8f;
  --icon-darkblue: #657684;
  --icon-pink: #b28f8f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #262523;   /* 穩定深灰 */
    --heading-color: #f0ede6;      /* 米白標題 */
    --text-color: #d8d4cb;         /* 正文亮度↑ */
    --blockquote-color: #c2beb5;

    --link-color: #a6c3bb;
    --visited-color: #bfaeb8;

    --timeline-line: #6a665f;
    --timeline-date: #a09b94;

    /* 節點色（避免糊掉） */
    --icon-gray: #c2beb5;
    --icon-blue: #aac1c0;
    --icon-green: #bccab5;
    --icon-purple: #c5b7c8;
    --icon-red: #d6b0b0;
    --icon-orange: #e0c1aa;
    --icon-teal: #a6c3bb;
    --icon-darkblue: #9aa7b2;
    --icon-pink: #d9b3b3;
  }
}

html {
  overflow-y: scroll;
}

/* ==================== image ==================== */
/* layouts/shortcodes/figure.html */
figure {
  margin: 1.5rem 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px; /* 可選 */
}

figure figcaption {
  color: var(--text-color);              /* 淺灰色 */
  font-size: 0.9em;         /* 比正文小 */
  line-height: 1.4;
  font-style: normal;       /* 若不想斜體可刪掉 */
}

figure figcaption p {
  margin: 0;                /* 避免 caption 過度 spacing */
}

/* ==================== calendar icon ==================== */
.post-date i {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.icon-calendar {
  width: 14px;
  height: 14px;
  margin-bottom: 2px;
  fill: currentColor;
}

/* ==================== timeline ==================== */
.timeline-wrapper {
  max-width: 800px;
  margin: 2rem auto;
}

.timeline-year-block {
  margin-bottom: 3rem;
}

.year-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 1.5rem;
  color: var(--heading-color);
}

.post-count {
  font-size: 14px;
  color: var(--timeline-date);
}

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

/* 時間軸主線 */
.timeline-list::before {
  content: '';
  position: absolute;
  left: 67px; /* 45px (date width) + 15px (date padding-right) + 16px (marker center) */
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--timeline-line);
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  position: relative;
}

.timeline-date {
  flex-shrink: 0;
  width: 50px;          /* ⭐ 固定寬度，依你的設計可調 */
  font-size: 14px;
  color: var(--timeline-date);
  text-align: left;
  padding-top: 6px;
}

.timeline-marker {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background-color);
  border: 2px solid;
  margin-right: 15px;
  position: relative;
  z-index: 1;
}

.timeline-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Icon colors */
.icon-gray { border-color: var(--icon-gray); color: var(--icon-gray); }
.icon-blue { border-color: var(--icon-blue); color: var(--icon-blue); }
.icon-green { border-color: var(--icon-green); color: var(--icon-green); }
.icon-red { border-color: var(--icon-red); color: var(--icon-red); }
.icon-orange { border-color: var(--icon-orange); color: var(--icon-orange); }
.icon-purple { border-color: var(--icon-purple); color: var(--icon-purple); }
.icon-pink { border-color: var(--icon-pink); color: var(--icon-pink); }
.icon-teal { border-color: var(--icon-teal); color: var(--icon-teal); }
.icon-darkblue { border-color: var(--icon-darkblue); color: var(--icon-darkblue); }

/* Hover 效果 */
.timeline-item:hover .timeline-marker {
  transform: scale(1.3);
}

.timeline-content {
  flex: 1;
  padding-top: 6px;
}

.timeline-post-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s;
}

.timeline-content summary.timeline-post-link {
  cursor: pointer;
  text-decoration: none;
}

.timeline-content summary.timeline-post-link:hover {
  text-decoration: underline;
}

.timeline-post-tags {
  margin: 0;
  font-size: 14px;
}

.timeline-post-tags a {
  color: var(--blockquote-color);
  text-decoration: none;
  margin-right: 0.5rem;
  transition: color 0.2s;
}

.timeline-post-tags a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

/* ==================== filter ==================== */
.tag-filter-header {
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.filter-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-icon {
  width: 20px;
  height: 20px;
  color: var(--link-color);
}

.remove-filter {
  color: var(--muted-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.remove-filter:hover {
  color: var(--link-color);
}

/* 預設：顯示 View all */
.tag-details .label-close {
  display: none;
}

/* 展開時：顯示 View less */
.tag-details[open] .label-open {
  display: none;
}

.tag-details[open] .label-close {
  display: inline;
}

/* ==================== timeline shortcode ==================== */
.timeline-shortcode {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.timeline-shortcode::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--timeline-line);
}

.timeline-p {
  color: var(--blockquote-color);
  margin: 0;
  font-size: 14px;
}

/* ==================== footer ==================== */
footer a {
  color: var(--text-color);
}

footer a:hover {
  color: var(--link-color);
}