/* ============================================================
   褶皱宇宙 · 手账式时间线
   纸质质感 + 左右错落 + 呼吸节点 + 进度入场 + 宇宙主题
   ============================================================ */

/* ---------- 区块容器 ---------- */
.journey-section {
  margin-block: var(--section-space);
  position: relative;
}

/* 副标题装饰线 */
.journey-section .section-subheading {
  position: relative;
  margin-bottom: 3rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--muted, #999);
}
.journey-section .section-subheading::after {
  content: "";
  display: block;
  width: clamp(48px, 12vw, 100px);
  height: 1px;
  margin: 1.1rem auto 0;
  background: linear-gradient(90deg, transparent, var(--sage, #6b9080), transparent);
  opacity: 0.45;
}

/* ---------- 时间线骨架 ---------- */
.journey-section .timeline.journal-timeline {
  position: relative;
  border-left: 0;
  margin: 0;
  padding: 0 0 0 clamp(2.5rem, 6vw, 3.5rem);
}

/* 虚线轴 — 渐变透明度 */
.journey-section .journal-timeline::before {
  content: "";
  position: absolute;
  left: clamp(1.1rem, 2.5vw, 1.5rem);
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1.5px dashed rgba(107, 144, 128, 0.22);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 6%, rgba(0,0,0,1) 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 6%, rgba(0,0,0,1) 94%, transparent 100%);
}

/* 卡片入场动画 */
@keyframes journal-card-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ---------- 年份分节 ---------- */
.timeline-year {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 2rem 0 1.6rem;
  margin-left: calc(clamp(1.1rem, 2.5vw, 1.5rem) * -1 - 0.6em);
  padding-left: 0;
}
.timeline-year:first-child {
  margin-top: 0.5rem;
}

.year-pill {
  flex: none;
  padding: 0.25rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sage-deep, #4f7669);
  background: var(--surface-solid, #fffdf7);
  border: 1px solid rgba(107, 144, 128, 0.25);
  border-radius: 999px;
  box-shadow: 0 0 0 5px var(--surface-solid, #fffdf7);
  transition: border-color 0.3s;
}
.year-pill:hover {
  border-color: rgba(107, 144, 128, 0.5);
}

.year-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(107, 144, 128, 0.28), transparent 80%);
}

/* ---------- 卡片节点 ---------- */
.journey-section .timeline-node.journal-card {
  position: relative;
  margin: 0 0 1.8rem;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: journal-card-enter 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.journey-section .timeline-node.journal-card:nth-child(1) { animation-delay: 0.1s; }
.journey-section .timeline-node.journal-card:nth-child(2) { animation-delay: 0.22s; }
.journey-section .timeline-node.journal-card:nth-child(3) { animation-delay: 0.34s; }
.journey-section .timeline-node.journal-card:nth-child(4) { animation-delay: 0.46s; }
.journey-section .timeline-node.journal-card:nth-child(5) { animation-delay: 0.58s; }
.journey-section .timeline-node.journal-card:nth-child(6) { animation-delay: 0.7s; }
.journey-section .timeline-node.journal-card:last-child {
  margin-bottom: 0;
}
.journey-section .timeline-node.journal-card::before {
  content: none;
}

/* 节点圆点 — 呼吸光晕 */
.journey-section .journal-card .node-dot {
  position: absolute;
  left: calc(clamp(1.1rem, 2.5vw, 1.5rem) * -1);
  top: 1.6rem;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sage, #6b9080);
  border: 2.5px solid var(--surface-solid, #fffdf7);
  box-shadow: 0 0 0 0 rgba(107, 144, 128, 0.35);
  animation: journal-node-pulse 4s ease-in-out infinite;
  z-index: 2;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.journey-card:hover .node-dot {
  background: var(--clay, #b78168);
  transform: translateX(-50%) scale(1.3);
  box-shadow: 0 0 0 4px rgba(183, 129, 104, 0.15);
}
.journey-section .journal-card:nth-of-type(2) .node-dot { animation-delay: 0.8s; }
.journey-section .journal-card:nth-of-type(3) .node-dot { animation-delay: 1.5s; }
.journey-section .journal-card:nth-of-type(4) .node-dot { animation-delay: 2.2s; }

@keyframes journal-node-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(107, 144, 128, 0.35); }
  50%      { box-shadow: 0 0 0 8px rgba(107, 144, 128, 0); }
}

/* ---------- 卡片主体 ---------- */
.journey-card .node-content {
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(108, 120, 98, 0.12);
  background: var(--surface, rgba(255, 252, 245, 0.82));
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  box-shadow:
    0 1px 3px rgba(80, 78, 64, 0.04),
    0 8px 24px rgba(80, 78, 64, 0.06);
  background-image: radial-gradient(rgba(120, 110, 90, 0.04) 0.8px, transparent 0.8px);
  background-size: 16px 16px;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1),
              border-color 0.4s ease;
}

/* 左右错落 + 轻微旋转 */
.journal-card.journal-left .node-content {
  margin-right: clamp(2rem, 10vw, 6rem);
  transform: rotate(-0.4deg);
}
.journal-card.journal-right .node-content {
  margin-left: clamp(2rem, 10vw, 6rem);
  transform: rotate(0.5deg);
}

/* 悬停：抬起 + 阴影 + 旋转归零 */
.journey-card .node-content:hover {
  transform: rotate(0deg) translateY(-8px);
  box-shadow:
    0 4px 12px rgba(80, 78, 64, 0.05),
    0 24px 48px rgba(80, 78, 64, 0.1),
    0 0 0 1px rgba(107, 144, 128, 0.08);
  border-color: rgba(107, 144, 128, 0.28);
}

.journey-card .node-content a {
  display: block;
  padding: clamp(1.2rem, 3vw, 1.6rem);
  text-decoration: none;
  color: inherit;
}

/* 卡片封面图 */
.card-image {
  margin: calc(clamp(1.2rem, 3vw, 1.6rem) * -1);
  margin-bottom: clamp(1rem, 2.5vw, 1.3rem);
  overflow: hidden;
  max-height: 180px;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.journey-card .node-content:hover .card-image img {
  transform: scale(1.04);
}

/* ---------- 卡片内部排版 ---------- */
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.journey-card .node-content h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: #2a3328;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

/* 右上角贴纸 */
.corner-sticker {
  flex: none;
  padding: 0.15rem 0.55rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--clay, #b78168);
  background: rgba(183, 129, 104, 0.1);
  border: 1px dashed rgba(183, 129, 104, 0.35);
  border-radius: 6px;
  transform: rotate(3.5deg);
  white-space: nowrap;
  transition: transform 0.3s;
}
.journal-left .corner-sticker {
  transform: rotate(-2.5deg);
}
.journey-card:hover .corner-sticker {
  transform: rotate(0deg);
}

.card-quote {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--muted, #6b7268);
}

/* ---------- 书签标签 ---------- */
.journey-card .book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
}
.journey-card .book-tags .tag {
  padding: 0.18rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 5px;
  color: var(--sage-deep, #4f7669);
  background: rgba(107, 144, 128, 0.08);
  border: 1px solid rgba(107, 144, 128, 0.14);
  transition: all 0.3s ease;
}
.journey-card .book-tags .tag-read {
  color: var(--clay, #b78168);
  background: rgba(183, 129, 104, 0.1);
  border-color: rgba(183, 129, 104, 0.24);
}
.journey-card .node-content:hover .tag-read {
  background: rgba(183, 129, 104, 0.18);
}

/* ---------- 进度条 ---------- */
.reading-meta {
  margin-top: 0.5rem;
}

.journey-card .progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.68rem;
  color: var(--muted, #999);
  margin: 0.4rem 0 0.35rem;
}
.journey-card .progress-label span:last-child {
  color: var(--sage-deep, #4f7669);
  font-weight: 600;
  font-size: 0.7rem;
}

.journey-card .progress-bar {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(107, 144, 128, 0.1);
}
.journey-card .progress {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage, #6b9080), var(--sky, #6f94b8));
  transition: width 1.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}
.journey-card .progress::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: inherit;
}

/* 半截思考 */
.half-thought {
  margin: 0.8rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(107, 144, 128, 0.18);
  font-size: 0.76rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--sage-deep, #4f7669);
}

/* ---------- 批注便签卡片 ---------- */
.journal-note .node-content {
  background-color: rgba(255, 248, 234, 0.85);
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 28px,
      rgba(107, 144, 128, 0.06) 28px,
      rgba(107, 144, 128, 0.06) 29px
    ),
    radial-gradient(rgba(120, 110, 90, 0.04) 0.8px, transparent 0.8px);
  background-size: auto, 16px 16px;
  border-color: rgba(183, 129, 104, 0.12);
  border-left: 3px solid rgba(183, 129, 104, 0.25);
}

.note-tag {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.14rem 0.5rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--clay, #b78168);
  background: rgba(183, 129, 104, 0.1);
  border-radius: 4px;
}

.note-quote {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.75;
  color: #2a3328;
}

.note-source {
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  text-align: right;
  color: var(--muted, #999);
}

.note-resonance {
  margin: 0;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(107, 144, 128, 0.18);
  font-size: 0.74rem;
  line-height: 1.65;
  color: var(--sage-deep, #4f7669);
}

/* ---------- 暗色模式 ---------- */
.dark-mode .year-pill {
  color: #a8c4b8;
  background-color: rgba(35, 38, 35, 0.95);
  border-color: rgba(107, 144, 128, 0.35);
  box-shadow: 0 0 0 5px rgba(28, 28, 28, 0.95);
}
.dark-mode .year-rule {
  background: linear-gradient(90deg, rgba(138, 171, 154, 0.3), transparent 80%);
}
.dark-mode .journey-section .journal-timeline::before {
  border-left-color: rgba(138, 171, 154, 0.3);
}
.dark-mode .journal-card .node-dot {
  background: #8aab9a;
  border-color: rgba(28, 28, 28, 0.95);
}
.dark-mode .journal-card .node-content {
  background-color: rgba(38, 38, 38, 0.92);
  background-image: radial-gradient(rgba(200, 210, 200, 0.03) 0.8px, transparent 0.8px);
  border-color: rgba(138, 171, 154, 0.14);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.1),
    0 8px 24px rgba(0, 0, 0, 0.15);
}
.dark-mode .journal-card .node-content h3 {
  color: #e8e8e8;
}
.dark-mode .card-quote,
.dark-mode .journey-card .progress-label {
  color: #aaa;
}
.dark-mode .journal-note .node-content {
  background-color: rgba(50, 44, 34, 0.88);
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 28px,
      rgba(200, 180, 140, 0.05) 28px,
      rgba(200, 180, 140, 0.05) 29px
    ),
    radial-gradient(rgba(200, 210, 200, 0.03) 0.8px, transparent 0.8px);
  border-left-color: rgba(183, 129, 104, 0.3);
}
.dark-mode .note-quote {
  color: #e8e8e8;
}
.dark-mode .journey-card .book-tags .tag {
  color: #a8c4b8;
  background: rgba(138, 171, 154, 0.1);
  border-color: rgba(138, 171, 154, 0.18);
}
.dark-mode .journey-card .book-tags .tag-read,
.dark-mode .corner-sticker,
.dark-mode .note-tag {
  color: #d8a890;
  background: rgba(183, 129, 104, 0.15);
  border-color: rgba(183, 129, 104, 0.28);
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .journey-section .timeline.journal-timeline {
    padding-left: 2rem;
  }
  .journey-section .journal-timeline::before {
    left: 0.7rem;
  }
  .timeline-year {
    margin-left: -1.3rem;
  }
  .journey-section .journal-card .node-dot {
    left: -1.1rem;
  }
  .journal-card.journal-left .node-content,
  .journal-card.journal-right .node-content {
    margin-left: 0;
    margin-right: 0;
    transform: rotate(0deg);
  }
  .corner-sticker {
    transform: rotate(2deg);
  }
  .journey-card .node-content a {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-section .journal-card .node-dot {
    animation: none;
  }
  .journey-section .timeline-node.journal-card {
    animation: none;
    filter: none;
  }
  .journey-card .node-content,
  .journey-card .progress {
    transition: none;
  }
  .journal-card.journal-left .node-content,
  .journal-card.journal-right .node-content {
    transform: rotate(0deg);
  }
}
