/* ============================================
   Editorial Typography System (Initium-inspired)
   ============================================ */

/* Use system font for ASCII punctuation to avoid CJK full-width spacing */
@font-face {
  font-family: 'Punctuation Fix';
  src: local('Georgia'), local('Times New Roman'), local('serif');
  unicode-range: U+0020-002F, U+003A-0040, U+005B-0060, U+007B-007E, U+2018-201F;
}

:root {
  /* Font Families */
  --font-display: 'Punctuation Fix', 'Noto Serif SC', Georgia, serif;
  --font-serif: 'Punctuation Fix', 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Punctuation Fix', 'Noto Serif SC', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', 'Menlo', monospace;

  /* Type Scale (1.25 ratio) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;

  /* Colors - Vibrant palette */
  --color-bg: #faf9f7;
  --color-surface: #ffffff;
  --color-text: #222222;
  --color-text-secondary: #555555;
  --color-text-tertiary: #6b6b6b;
  --color-accent: #0b6f87;
  --color-accent-hover: #095e72;
  --color-accent-2: #8b5cf6;
  --color-accent-3: #f59e0b;
  --color-gradient: linear-gradient(135deg, #29a6c9 0%, #8b5cf6 100%);
  --color-border: #e0e0e0;
  --color-border-light: #f0f0f0;
  --color-code-bg: #f5f5f5;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --max-width: 1100px;
  --content-width: 720px;
  /* Radius Scale */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-full: 999px;

  /* Shadow Scale */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 14px 30px rgba(0, 0, 0, 0.12);
  --shadow-accent: 0 8px 30px rgba(14, 124, 149, 0.1);
  --shadow-accent-hover: 0 14px 30px rgba(14, 124, 149, 0.14);

  /* Transition Presets */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 0.15s;
  --duration-base: 0.2s;
  --duration-slow: 0.3s;
  --duration-slower: 0.4s;

  /* Travel theme palette */
  --travel-bg: #faf7f2;
  --travel-muted: #8a7e6e;
}

/* Traditional Chinese font override */
.traditional {
  --font-display: 'Punctuation Fix', 'Noto Serif TC', Georgia, serif;
  --font-serif: 'Punctuation Fix', 'Noto Serif TC', Georgia, serif;
  --font-sans: 'Punctuation Fix', 'Noto Serif TC', Georgia, serif;
}

/* Dark mode - optimized for readability */
.dark {
  --color-bg: #161616;
  --color-surface: #1e1e1e;
  --color-text: #efefef;
  --color-text-secondary: #b8b8b8;
  --color-text-tertiary: #8a8a8a;
  --color-accent: #4cc9e8;
  --color-accent-hover: #6dd8f2;
  --color-accent-2: #b19afc;
  --color-accent-3: #fbbf24;
  --color-gradient: linear-gradient(135deg, #4cc9e8 0%, #b19afc 100%);
  --color-border: #3d3d3d;
  --color-border-light: #2d2d2d;
  --color-code-bg: #1c1c1c;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 14px 30px rgba(0, 0, 0, 0.3);
  --shadow-accent: 0 8px 30px rgba(76, 201, 232, 0.08);
  --shadow-accent-hover: 0 14px 30px rgba(76, 201, 232, 0.12);

  /* Travel theme palette (dark) */
  --travel-bg: #2a2520;
  --travel-muted: #8a7e6e;
  --travel-border: #4a4035;
}

/* ============================================
   Reset & Base
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Skip Link (Accessibility) */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--space-4);
  z-index: 10000;
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: top var(--duration-fast) var(--ease-smooth);
}

.skip-link:focus {
  top: 0;
}

/* Disable mobile tap highlight globally */
*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
}

/* Remove outline for pointer/touch interactions */
:focus:not(:focus-visible) {
  outline: none;
}

/* Focus-visible for keyboard accessibility only */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: scroll;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
}

body.travel-page {
  background:
    repeating-linear-gradient(
      160deg,
      transparent,
      transparent 3px,
      rgba(180, 160, 120, 0.025) 3px,
      rgba(180, 160, 120, 0.025) 4px
    ),
    repeating-linear-gradient(
      25deg,
      transparent,
      transparent 5px,
      rgba(165, 145, 105, 0.02) 5px,
      rgba(165, 145, 105, 0.02) 6px
    ),
    var(--color-bg);
}

.dark body.travel-page {
  background:
    repeating-linear-gradient(
      160deg,
      transparent,
      transparent 3px,
      rgba(140, 120, 80, 0.03) 3px,
      rgba(140, 120, 80, 0.03) 4px
    ),
    repeating-linear-gradient(
      25deg,
      transparent,
      transparent 5px,
      rgba(130, 110, 75, 0.02) 5px,
      rgba(130, 110, 75, 0.02) 6px
    ),
    linear-gradient(170deg, #1c1a17 0%, #191714 100%);
}

/* Screen reader only - visually hidden but SEO visible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Animations
   ============================================ */

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

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-in {
  animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes iconWobble {
  0% { transform: scale(1.15) rotate(0deg); }
  25% { transform: scale(1.15) rotate(-8deg); }
  50% { transform: scale(1.15) rotate(6deg); }
  75% { transform: scale(1.15) rotate(-3deg); }
  100% { transform: scale(1.15) rotate(0deg); }
}

@keyframes arrowBounce {
  from { transform: translateX(0); }
  to { transform: translateX(6px); }
}



@keyframes sparkleRotate {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(90deg) scale(0.8); }
  100% { transform: rotate(180deg) scale(1); }
}

/* ============================================
   Reading Progress Bar
   ============================================ */

.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-gradient);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 1000;
  will-change: transform;
  backface-visibility: hidden;
  box-shadow: 0 0 8px rgba(14, 124, 149, 0.4), 0 0 2px rgba(14, 124, 149, 0.2);
}

.dark .reading-progress-bar {
  box-shadow: 0 0 8px rgba(76, 201, 232, 0.4), 0 0 2px rgba(76, 201, 232, 0.2);
}

/* ============================================
   Site Header
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-header::before {
  content: '';
  position: absolute;
  top: -100vh;
  left: 0;
  right: 0;
  height: 100vh;
  background: inherit;
  z-index: -1;
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
  letter-spacing: 0.05em;
  transition: color var(--duration-slow) ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.nav-cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background: var(--color-accent);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

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

.nav-title:hover {
  background: var(--color-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-title:hover .nav-cursor {
  background: var(--color-accent-2);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-links a {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--duration-base);
}

.nav-links a:hover {
  color: var(--color-accent);
}

/* Theme Toggle - Three-way Slider */
.theme-toggle {
  --theme-item: 30px;
  --theme-gap: 2px;
  --theme-pad: 3px;
}

.theme-toggle__track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, var(--theme-item));
  gap: var(--theme-gap);
  padding: var(--theme-pad);
  border-radius: var(--radius-full);
  background: #f1f5f9;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .theme-toggle__track {
  background: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
  border: 1px solid transparent;
  border-top-color: #252525;
  border-bottom-color: #4a4a4a;
  border-left-color: #303030;
  border-right-color: #404040;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.6),
    inset 0 -1px 1px rgba(255, 255, 255, 0.05),
    0 1px 2px rgba(255, 255, 255, 0.08);
}

.theme-toggle__indicator {
  position: absolute;
  top: var(--theme-pad);
  left: var(--theme-pad);
  width: var(--theme-item);
  height: var(--theme-item);
  border-radius: 50%;
  transform: translateX(calc(var(--theme-index, 0) * (var(--theme-item) + var(--theme-gap))));
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s var(--ease-bounce);
  will-change: transform;
  z-index: 0;
}

.dark .theme-toggle__indicator {
  background: linear-gradient(180deg, #454545 0%, #2a2a2a 100%);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.theme-toggle__btn {
  height: var(--theme-item);
  width: var(--theme-item);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color var(--duration-base) ease;
}

.theme-toggle__btn:hover {
  color: #64748b;
}

.dark .theme-toggle__btn {
  color: #606060;
}

.dark .theme-toggle__btn:hover {
  color: #909090;
}

.theme-toggle__btn.active {
  color: #334155;
}

.dark .theme-toggle__btn.active {
  color: #efefef;
}

.theme-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ============================================
   Main Content
   ============================================ */

.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
}

/* ============================================
   Home Page - Initium-style Grid Layout
   ============================================ */

/* Home */
.home {
  min-height: 50vh;
  position: relative;
}

/* Section Tagline */
.section-tagline {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .section-tagline {
    display: none;
  }
}

/* Section Sparkle (Josh Comeau-inspired 4-pointed star) */
.section-sparkle {
  color: var(--color-accent);
  flex-shrink: 0;
  margin-left: -6px;
  animation: sparkle 5s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { transform: scale(0.8) rotate(0deg); opacity: 0.35; }
  50% { transform: scale(1.15) rotate(90deg); opacity: 0.9; }
}

/* Tag Filter */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-10);
}

.tag-filter-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-code-bg);
  color: var(--color-text-tertiary);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-base) ease,
              background var(--duration-base) ease,
              border-color var(--duration-base) ease,
              box-shadow var(--duration-base) ease,
              transform 0.15s var(--ease-bounce);
}

.tag-filter-btn:hover {
  color: var(--color-accent);
  background: transparent;
  border-color: var(--color-accent);
}

.tag-filter-btn:active {
  transform: scale(0.93);
}

.tag-filter-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 124, 149, 0.25);
}

.dark .tag-filter-btn {
  background: var(--color-code-bg);
}

.dark .tag-filter-btn.active {
  box-shadow: 0 2px 8px rgba(76, 201, 232, 0.2);
}

/* Archive Link */
.home-archive-link {
  text-align: center;
  margin-top: var(--space-12);
  padding-bottom: var(--space-8);
}

.home-archive-link a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.home-archive-link a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.home-archive-link a:active {
  transform: scale(0.97);
  transition: transform 0.1s;
}

.home-archive-link a svg {
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.home-archive-link a:hover svg {
  animation: arrowBounce 0.6s var(--ease-spring) infinite alternate;
}

.cards-section {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
  user-select: none;
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  letter-spacing: 0.06em;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), var(--color-accent-2), transparent);
  background-size: 200% 100%;
  opacity: 0.25;
  animation: lineShimmer 8s linear infinite;
}

@keyframes lineShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-10) var(--space-12);
}

.card {
  background: transparent;
  perspective: 800px;
}

.card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.4s ease-out, box-shadow 0.4s ease-out, background var(--duration-slow) ease, border-color var(--duration-slow) ease;
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
  overflow: hidden;
}

/* Shine glare overlay — driven by JS via --shine-x/--shine-y */
.card-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  border-radius: inherit;
  background: radial-gradient(circle at calc(var(--shine-x, 50) * 1%) calc(var(--shine-y, 50) * 1%), rgba(255,255,255,0.2) 0%, transparent 60%);
  transition: opacity 0.3s ease-out;
}

.card.tilt-active .card-link::before {
  opacity: 1;
}

.card-link:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-accent-hover);
}

.dark .card-link:hover {
  box-shadow: var(--shadow-accent);
}

.card-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-accent);
  background: rgba(14, 124, 149, 0.1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
  letter-spacing: 0.03em;
  transition: box-shadow 0.3s var(--ease-spring), background 0.3s ease;
}

.card:hover .card-tag {
  background: rgba(14, 124, 149, 0.15);
  box-shadow: 0 0 8px rgba(14, 124, 149, 0.25), 0 0 16px rgba(14, 124, 149, 0.1);
}

.dark .card:hover .card-tag {
  background: rgba(76, 201, 232, 0.15);
  box-shadow: 0 0 8px rgba(76, 201, 232, 0.3), 0 0 16px rgba(76, 201, 232, 0.12);
}

.card-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  transition: color var(--duration-base);
  margin: 0 0 var(--space-3) 0;
}

.card:hover .card-title {
  color: var(--color-accent);
}

.card-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0 0 var(--space-3) 0;
}

.card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  line-height: 1.7;
  margin: 0 0 var(--space-4) 0;
  flex-grow: 1;
}

.card-date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-top: auto;
  letter-spacing: 0.02em;
}

/* Card with image - Initium style horizontal layout */
.card.has-image .card-link {
  flex-direction: row;
  gap: var(--space-5);
}

.card-image {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-spring);
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* Responsive: smaller image on tablet */
@media (max-width: 900px) {
  .card-image {
    width: 140px;
    height: 140px;
  }
}

/* Responsive: stack vertically on mobile */
@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .card.has-image .card-link {
    flex-direction: column;
    gap: var(--space-4);
  }

  .card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

/* ============================================
   Card Entrance Animation
   ============================================ */
.cards-grid.has-entrance .card {
  opacity: 0;
}

.cards-grid.has-entrance .card.animate-in {
  animation: cardEntrance 0.6s var(--ease-spring) forwards;
}

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

/* Reduced motion: disable all decorative animations */
@media (prefers-reduced-motion: reduce) {
  .section-sparkle,
  .section-line {
    animation: none !important;
  }
  .section-sparkle {
    opacity: 0.6;
    transform: none;
  }
  .cards-grid.has-entrance .card {
    opacity: 1;
  }
  .cards-grid.has-entrance .card.animate-in {
    animation: none;
  }
}

/* ============================================
   Article Page
   ============================================ */

.article-wrapper {
  position: relative;
}

.article {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* Table of Contents */
.toc-sidebar {
  position: fixed;
  top: 100px;
  left: calc((100vw - var(--content-width)) / 2 - 280px);
  width: 240px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: var(--space-4);
}

.toc-sidebar::-webkit-scrollbar {
  display: none;
}

.toc-container {
  padding-right: var(--space-4);
}

.toc-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid transparent;
  border-image: var(--color-gradient) 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toc-title svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.toc-link {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--color-border-light);
  position: relative;
  transition: all var(--duration-base) ease;
  line-height: 1.5;
}

.toc-link::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-gradient);
  opacity: 0;
  transition: opacity var(--duration-base) ease;
}

.toc-link:hover {
  color: var(--color-text);
  background: var(--color-border-light);
}

.toc-link:hover::before {
  opacity: 0.5;
}

.toc-link.active {
  color: var(--color-accent);
  font-weight: 500;
  border-left-color: transparent;
}

.toc-link.active::before {
  opacity: 1;
}

.toc-h3 {
  padding-left: calc(var(--space-3) + 12px);
  font-size: var(--text-xs);
}

/* TOC completion message */
.toc-complete {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border-radius: var(--radius-md);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all var(--duration-slower) var(--ease-bounce);
  pointer-events: none;
}

.toc-complete.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.toc-complete svg {
  flex-shrink: 0;
  animation: toc-check-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes toc-check-pop {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.dark .toc-complete {
  background: rgba(34, 197, 94, 0.15);
}

/* Travel journal TOC style */
.travel-page .toc-container {
  background: var(--travel-bg);
  border: 1px solid #e8e2d6;
  border-radius: 2px;
  padding: var(--space-4) var(--space-5);
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  transform: rotate(-0.5deg);
}

.travel-page .toc-title {
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;
  font-size: var(--text-base);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.05em;
  color: #7a6f62;
  border-image: none;
  border-bottom: 1px dashed #d8d0c4;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
}

.travel-page .toc-link {
  font-family: 'LXGW WenKai TC', cursive;
  font-size: 13px;
  border-left: none;
  padding: 6px var(--space-2);
  color: var(--travel-muted);
  border-radius: 3px;
}

.travel-page .toc-link::before {
  content: '·';
  position: static;
  width: auto;
  height: auto;
  background: none;
  opacity: 1;
  margin-right: 6px;
  color: #c8bfb2;
  font-weight: 700;
}

.travel-page .toc-link:hover {
  background: rgba(200, 191, 178, 0.15);
  color: #5e5548;
}

.travel-page .toc-link:hover::before {
  opacity: 1;
  color: var(--travel-muted);
}

.travel-page .toc-link.active {
  color: #5e5548;
  font-weight: 500;
  background: rgba(200, 191, 178, 0.12);
}

.travel-page .toc-link.active::before {
  content: '→';
  opacity: 1;
  color: var(--travel-muted);
  background: none;
}

.travel-page .toc-nav {
  border-left: 1px dashed #e0d8ca;
  margin-left: var(--space-1);
}

.dark .travel-page .toc-container {
  background: var(--travel-bg);
  border-color: var(--travel-border);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.dark .travel-page .toc-title {
  color: #c8bfb2;
  border-bottom-color: var(--travel-border);
}

.dark .travel-page .toc-link {
  color: var(--travel-muted);
}

.dark .travel-page .toc-link::before {
  color: #5e5548;
}

.dark .travel-page .toc-link:hover {
  background: rgba(200, 191, 178, 0.08);
  color: #c8bfb2;
}

.dark .travel-page .toc-link.active {
  color: #c8bfb2;
  background: rgba(200, 191, 178, 0.06);
}

.dark .travel-page .toc-link.active::before {
  color: var(--travel-muted);
}

/* Hide desktop TOC on smaller screens */
@media (max-width: 1400px) {
  .toc-sidebar {
    display: none;
  }
}

/* Mobile TOC button - only visible when desktop TOC is hidden */
.toc-mobile-btn {
  display: none;
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  z-index: 90;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.toc-mobile-btn:hover {
  box-shadow: var(--shadow-lg);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

@media (max-width: 1400px) {
  .toc-mobile-btn {
    display: flex;
  }
}

/* Mobile TOC overlay */
.toc-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.toc-mobile-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile TOC drawer */
.toc-mobile-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 60vh;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
  z-index: 999;
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-smooth);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.toc-mobile-drawer.show {
  transform: translateY(0);
}

.toc-mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}

.toc-mobile-drawer-header .toc-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  border-image: none;
}

.toc-mobile-close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-md);
}

.toc-mobile-close:hover {
  color: var(--color-text);
}

.toc-mobile-nav {
  padding: var(--space-4) var(--space-6) var(--space-8);
  display: flex;
  flex-direction: column;
}

.toc-mobile-nav .toc-link {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--color-border-light);
  transition: color var(--duration-fast) var(--ease-smooth);
}

.toc-mobile-nav .toc-link:last-child {
  border-bottom: none;
}

.toc-mobile-nav .toc-link:hover,
.toc-mobile-nav .toc-link:active {
  color: var(--color-accent);
}

.toc-mobile-nav .toc-h3 {
  padding-left: var(--space-6);
  font-size: var(--text-xs);
}

.article-header {
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border-light);
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.article-date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}

.article-reading-time {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.article-reading-time svg {
  opacity: 0.7;
}

/* Font size controls */
.chinese-convert-btn {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--space-2);
}

.chinese-convert-label {
  font-weight: 500;
  line-height: 1;
}


.font-size-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-tertiary);
  transition: color var(--duration-base);
}

.tool-btn:hover {
  color: var(--color-accent);
}

.font-size-label {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  min-width: 1.5em;
  text-align: center;
}

/* Continue reading banner */
.continue-reading-banner {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 32px -4px rgba(43, 42, 39, 0.12), 0 2px 8px -2px rgba(43, 42, 39, 0.06);
  z-index: 1000;
  font-size: var(--text-sm);
  white-space: nowrap;
  animation: bannerSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bannerSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.continue-reading-banner span {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.continue-reading-banner button {
  border: none;
  cursor: pointer;
  transition: all var(--duration-base);
}

#continue-reading {
  background: var(--color-accent);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
}

#continue-reading:hover {
  background: var(--color-accent-hover);
}

#continue-reading:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}

#dismiss-banner {
  background: transparent;
  color: var(--color-text-tertiary);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  font-size: 1rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#dismiss-banner:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.05);
}

.dark .continue-reading-banner {
  background: rgba(30, 30, 30, 0.45);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.4);
}

.dark #dismiss-banner:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Journal-style continue reading banner for travels */
.continue-reading-journal {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(180, 160, 130, 0.10) 27px,
      rgba(180, 160, 130, 0.10) 28px
    ),
    linear-gradient(135deg, #faf8f4 0%, #f5f0e8 100%);
  border: 1px solid #e0d8c8;
  border-radius: 2px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    2px 2px 0 #f0ebe3,
    3px 3px 0 #e8e2d8;
  transform: translateX(-50%);
  padding: var(--space-3) var(--space-6);
}

.continue-reading-journal span {
  color: #5e5548;
}

.continue-reading-journal #continue-reading {
  background: rgba(100, 140, 120, 0.75);
  color: #faf8f4;
  border-radius: 2px;
}

.continue-reading-journal #continue-reading:hover {
  background: rgba(100, 140, 120, 0.9);
}

.continue-reading-journal #dismiss-banner {
  color: #b5a78e;
}

.continue-reading-journal #dismiss-banner:hover {
  color: #5e5548;
}

.dark .continue-reading-journal {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(160, 140, 110, 0.06) 27px,
      rgba(160, 140, 110, 0.06) 28px
    ),
    linear-gradient(135deg, #2a2723 0%, #252220 100%);
  border-color: #3d362e;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.25),
    2px 2px 0 #2e2a25,
    3px 3px 0 #262320;
}

.dark .continue-reading-journal span {
  color: #c8bfb2;
}

.dark .continue-reading-journal #continue-reading {
  background: rgba(100, 140, 120, 0.5);
  color: #e8e2d8;
}

.dark .continue-reading-journal #continue-reading:hover {
  background: rgba(100, 140, 120, 0.65);
}

.dark .continue-reading-journal #dismiss-banner {
  color: #6b5f52;
}

.dark .continue-reading-journal #dismiss-banner:hover {
  color: #c8bfb2;
}

.article-title {
  font-family: 'Punctuation Fix', 'Noto Serif SC', Georgia, serif;
  font-size: var(--text-3xl);
  font-weight: 700;
  font-style: normal;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.article-subtitle {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-weight: 400;
}

.travel-page .article-title {
  font-family: 'LXGW WenKai TC', cursive;
  text-align: center;
  letter-spacing: 0.05em;
  font-weight: 400;
}

.travel-page .article-subtitle {
  font-family: 'LXGW WenKai TC', cursive;
  text-align: center;
}

.travel-page .article-content.prose h2,
.travel-page .article-content.prose h3,
.travel-page .article-content.prose h4 {
  font-family: 'LXGW WenKai TC', cursive;
  text-align: center;
  font-weight: 400;
}

.traditional .travel-page .article-title,
.traditional .travel-page .article-subtitle,
.traditional .travel-page .article-content.prose h2,
.traditional .travel-page .article-content.prose h3,
.traditional .travel-page .article-content.prose h4 {
  font-family: 'Klee One', cursive;
}

.traditional .travel-page .toc-title {
  font-family: 'Kaiti TC', 'BiauKai', 'DFKai-SB', 'KaiTi', 'STKaiti', cursive;
}

.traditional .travel-page .toc-link {
  font-family: 'Klee One', cursive;
}

.traditional .travel-page .share-label,
.traditional .travel-page .nav-label {
  font-family: 'Kaiti TC', 'BiauKai', 'DFKai-SB', 'KaiTi', 'STKaiti', cursive;
}

.traditional .travel-page .nav-title {
  font-family: 'Klee One', cursive;
}

/* Travel journal dot grid background */
.travel-content {
  position: relative;
}

.travel-content img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.travel-content img.loaded {
  opacity: 1;
}

.travel-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #c8bfb2 0.6px, transparent 0.6px);
  background-size: 20px 20px;
  background-position: 10px 10px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.dark .travel-content::before {
  background-image: radial-gradient(circle, #8a7e70 0.6px, transparent 0.6px);
  opacity: 0.12;
}

.travel-content > * {
  position: relative;
  z-index: 1;
}


/* Travel icon dividers */
.travel-content h2::before {
  content: '';
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto var(--space-2);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.55;
  pointer-events: none;
}

.travel-content h2::after {
  content: '';
  display: block;
  width: 120px;
  height: 8px;
  margin: var(--space-2) auto 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8'%3E%3Ccircle cx='6' cy='4' r='1.2' fill='%23c8bfb2'/%3E%3Ccircle cx='14' cy='4' r='1.2' fill='%23c8bfb2'/%3E%3Cpath d='M24 4 Q34 0 44 4 Q54 8 64 4 Q74 0 84 4 Q94 8 96 4' fill='none' stroke='%23c8bfb2' stroke-width='1.2' stroke-linecap='round'/%3E%3Ccircle cx='106' cy='4' r='1.2' fill='%23c8bfb2'/%3E%3Ccircle cx='114' cy='4' r='1.2' fill='%23c8bfb2'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.6;
  pointer-events: none;
}

.dark .travel-content h2::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8'%3E%3Ccircle cx='6' cy='4' r='1.2' fill='%236b5f52'/%3E%3Ccircle cx='14' cy='4' r='1.2' fill='%236b5f52'/%3E%3Cpath d='M24 4 Q34 0 44 4 Q54 8 64 4 Q74 0 84 4 Q94 8 96 4' fill='none' stroke='%236b5f52' stroke-width='1.2' stroke-linecap='round'/%3E%3Ccircle cx='106' cy='4' r='1.2' fill='%236b5f52'/%3E%3Ccircle cx='114' cy='4' r='1.2' fill='%236b5f52'/%3E%3C/svg%3E");
}

.travel-content h2:nth-of-type(7n+1)::before {
  background-image: url('../images/travel-icons/compass-svgrepo-com.svg');
}
.travel-content h2:nth-of-type(7n+2)::before {
  background-image: url('../images/travel-icons/camera-svgrepo-com.svg');
}
.travel-content h2:nth-of-type(7n+3)::before {
  background-image: url('../images/travel-icons/map-svgrepo-com.svg');
}
.travel-content h2:nth-of-type(7n+4)::before {
  background-image: url('../images/travel-icons/air-ticket-svgrepo-com.svg');
}
.travel-content h2:nth-of-type(7n+5)::before {
  background-image: url('../images/travel-icons/passport-svgrepo-com.svg');
}
.travel-content h2:nth-of-type(7n+6)::before {
  background-image: url('../images/travel-icons/suitcase-svgrepo-com.svg');
}
.travel-content h2:nth-of-type(7n+7)::before {
  background-image: url('../images/travel-icons/bag-svgrepo-com.svg');
}

/* Travel journal */
.travel-journal-wrapper {
  margin-top: var(--space-5);
  padding: 16px 14px 12px;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(180, 160, 130, 0.10) 27px,
      rgba(180, 160, 130, 0.10) 28px
    ),
    linear-gradient(135deg, #faf8f4 0%, #f5f0e8 100%);
  border-radius: 3px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    2px 2px 0 #f0ebe3,
    3px 3px 0 #e8e2d8,
    3px 3px 6px rgba(0, 0, 0, 0.06);
}

.dark .travel-journal-wrapper {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(160, 140, 110, 0.06) 27px,
      rgba(160, 140, 110, 0.06) 28px
    ),
    linear-gradient(135deg, #2a2723 0%, #252220 100%);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    2px 2px 0 #1f1d1a,
    3px 3px 0 #1a1816,
    3px 3px 6px rgba(0, 0, 0, 0.15);
}

/* Map sticker */
.travel-header-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  height: 200px;
  border: 3px solid #fff;
  box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.10);
}

.dark .travel-header-card {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.2);
}

.travel-header-map-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.travel-header-map-dark {
  display: none;
}

.dark .travel-header-map-light {
  display: none;
}

.dark .travel-header-map-dark {
  display: block;
}

/* Info strip below map */
.travel-header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
}

.travel-header-info-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.travel-header-location {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.travel-header-location svg {
  color: var(--color-accent);
  flex-shrink: 0;
}

.travel-header-desc {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  line-height: 1.6;
  font-style: italic;
}

/* Postmark date stamp */
.travel-header-stamp {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border: 2px dashed rgba(180, 80, 50, 0.45);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(10deg);
  color: rgba(180, 80, 50, 0.7);
  line-height: 1.1;
}

.dark .travel-header-stamp {
  border-color: rgba(210, 140, 100, 0.35);
  color: rgba(210, 140, 100, 0.6);
}

.travel-stamp-year {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.travel-stamp-day {
  font-size: 15px;
  font-weight: 700;
}

/* Travel Ratings */
.travel-ratings {
  margin-top: var(--space-8);
  padding: 20px 24px;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(180, 160, 130, 0.10) 27px,
      rgba(180, 160, 130, 0.10) 28px
    ),
    linear-gradient(135deg, #faf8f4 0%, #f5f0e8 100%);
  border-radius: 3px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    2px 2px 0 #f0ebe3,
    3px 3px 0 #e8e2d8,
    3px 3px 6px rgba(0, 0, 0, 0.06);
}

.dark .travel-ratings {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(160, 140, 110, 0.06) 27px,
      rgba(160, 140, 110, 0.06) 28px
    ),
    linear-gradient(135deg, #2a2723 0%, #252220 100%);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    2px 2px 0 #1f1d1a,
    3px 3px 0 #1a1816,
    3px 3px 6px rgba(0, 0, 0, 0.15);
}

.travel-ratings-title {
  font-family: 'LXGW WenKai TC', cursive;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(180, 160, 130, 0.3);
}

.travel-rating-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.travel-rating-label {
  font-family: 'LXGW WenKai TC', cursive;
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  width: 72px;
  flex-shrink: 0;
}

.travel-rating-stars {
  display: flex;
  gap: 3px;
}

.travel-rating-star-filled {
  fill: var(--color-accent-3);
}

.travel-rating-star-empty {
  fill: var(--color-border);
}

.dark .travel-rating-star-empty {
  fill: rgba(255, 255, 255, 0.15);
}

.travel-ratings-summary {
  font-family: 'LXGW WenKai TC', cursive;
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px dashed rgba(180, 160, 130, 0.3);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  background: rgba(14, 124, 149, 0.1);
  border: none;
  border-radius: 20px;
  color: var(--color-accent);
  text-decoration: none;
  letter-spacing: 0.03em;
  transform: translateZ(0);
  transition: all 0.25s var(--ease-bounce);
}

.tag:hover {
  background: rgba(14, 124, 149, 0.15);
  color: var(--color-accent-hover);
  transform: translateY(-1px) translateZ(0);
  box-shadow: 0 0 12px rgba(14, 124, 149, 0.4), 0 0 24px rgba(14, 124, 149, 0.2);
}

.dark .tag:hover {
  background: rgba(61, 189, 224, 0.18);
  color: var(--color-accent);
  box-shadow: 0 0 12px rgba(61, 189, 224, 0.5), 0 0 24px rgba(61, 189, 224, 0.25);
}


/* ============================================
   Tag Page
   ============================================ */

.tag-page {
  max-width: var(--content-width);
  margin: 0 auto;
}

.tag-header {
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.tag-title {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: 700;
  background: var(--color-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-3);
}

.tag-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  letter-spacing: 0.05em;
}

.tag-page .posts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tag-page .post-item {
  border-bottom: 1px solid var(--color-border-light);
}

.tag-page .post-item:last-child {
  border-bottom: none;
}

.tag-page .post-link {
  display: block;
  padding: var(--space-8) 0;
  text-decoration: none;
  transition: background var(--duration-base);
}

.tag-page .post-link:hover .post-title {
  color: var(--color-accent);
}

.tag-page .post-meta {
  margin-bottom: var(--space-2);
}

.tag-page .post-date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}

.tag-page .post-title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 var(--space-2) 0;
  color: var(--color-text);
  transition: color var(--duration-base);
}

.tag-page .post-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-2) 0;
  line-height: 1.5;
}

.tag-page .post-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin: 0;
  line-height: 1.7;
}

/* Archive Page */
.archive-page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.archive-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.archive-title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.archive-count {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin: 0;
}

.archive-year {
  margin-bottom: var(--space-10);
}

.archive-year-title {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.archive-list {
  display: flex;
  flex-direction: column;
}

.archive-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-normal) var(--ease-smooth);
}

.archive-item:hover {
  border-bottom-color: var(--color-border);
}

.archive-item-date {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  min-width: 44px;
}

.archive-item-title {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  flex: 1;
  transition: color var(--duration-normal) var(--ease-smooth);
}

.archive-item:hover .archive-item-title {
  color: var(--color-accent);
}

.archive-item-tags {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.archive-item-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-tertiary);
  padding: 1px var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}

@media (max-width: 640px) {
  .archive-item {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .archive-item-tags {
    width: 100%;
    padding-left: 60px;
  }
}

/* ============================================
   Prose (Article Content)
   ============================================ */

.prose {
  font-family: 'Punctuation Fix', 'Noto Serif SC', Georgia, serif;
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text);
  max-width: var(--content-width);
}

.prose > * + * {
  margin-top: var(--space-6);
}

.prose h2 {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  color: var(--color-text);
  position: relative;
}

.prose h3 {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  position: relative;
}

/* Heading anchor — appears on hover */
.heading-anchor {
  position: absolute;
  left: -1.5em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7em;
  color: var(--color-text-tertiary);
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--duration-base) ease, color var(--duration-base) ease;
}

.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor {
  opacity: 0.5;
}

.heading-anchor:hover {
  opacity: 1 !important;
  color: var(--color-accent);
}

@media (max-width: 900px) {
  .heading-anchor { display: none; }
}

.prose p {
  text-align: justify;
  text-justify: inter-ideograph;
}

.prose a {
  color: var(--color-accent);
  text-decoration: none;
  position: relative;
}

.prose a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease-spring);
}

.prose a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.prose strong {
  font-weight: 700;
}

.prose em {
  font-style: italic;
}

/* Lists */
.prose ul, .prose ol {
  padding-left: var(--space-6);
}

.prose li {
  margin-top: var(--space-2);
}

.prose li::marker {
  color: var(--color-text-tertiary);
}

/* Blockquotes */
.prose blockquote {
  position: relative;
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, var(--color-accent), var(--color-accent-2)) 1;
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
  background: var(--color-border-light);
  border-radius: 0 4px 4px 0;
  font-style: normal;
  color: var(--color-text-secondary);
  transition: border-image var(--duration-slow) ease;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.dark .prose blockquote {
  background: var(--color-surface);
}

/* Code */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.prose .code-block-wrapper {
  position: relative;
}

.prose pre {
  background: var(--color-code-bg);
  padding: var(--space-5);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.6;
  border: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.prose .code-block-wrapper:hover pre {
  border-color: var(--color-border);
  box-shadow: 0 0 0 1px var(--color-border);
}

.dark .prose .code-block-wrapper:hover pre {
  border-color: var(--color-border);
  box-shadow: 0 0 12px rgba(76, 201, 232, 0.06);
}

/* Copy button — appears on hover */
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--duration-base) ease, color var(--duration-base) ease, background var(--duration-base) ease;
  z-index: 2;
  box-shadow: var(--shadow-xs);
}

.code-block-wrapper:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  color: var(--color-accent);
  background: var(--color-bg);
}

.code-copy-btn:active {
  transform: scale(0.9);
  transition: transform 0.1s;
}

.code-copy-btn.copied {
  color: #22c55e;
}

.dark .code-copy-btn {
  background: var(--color-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .code-copy-btn:hover {
  background: var(--color-surface);
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
  margin: var(--space-8) auto;
  -webkit-user-drag: none;
  user-drag: none;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease;
}

@media (hover: hover) {
  .prose > p > img:hover,
  .prose > figure > img:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

/* Image Lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.image-lightbox.show {
  opacity: 1;
  visibility: visible;
}

.image-lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 94vh;
  transform: scale(0.92);
  transition: transform 0.3s var(--ease-spring);
}

.image-lightbox.show .image-lightbox-content {
  transform: scale(1);
}

.image-lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  background: #fff;
}

.image-lightbox-caption {
  margin: 12px 0 0;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-sm);
  text-align: center;
  line-height: 1.5;
  max-width: 600px;
}

.image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Polaroid-style paired images for travel posts */
.prose .polaroid-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(0.75rem, 2vw, 1.5rem);
  align-items: end;
  margin: var(--space-10) 0 var(--space-12);
  padding: var(--space-2) 0;
}

.prose .polaroid-frame {
  position: relative;
  margin: 0;
  background: #f8f7f3;
  border: 1px solid #ebe7e0;
  border-radius: 2px;
  padding: 14px 14px 16px;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.14);
  transform-origin: center center;
}

.prose .polaroid-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0) 32%),
    radial-gradient(circle at 78% 86%, rgba(92, 77, 51, 0.06) 0%, rgba(92, 77, 51, 0) 42%);
  pointer-events: none;
}

.prose .polaroid-frame img {
  margin: 0;
  width: 100%;
  border-radius: 0;
}

.prose .polaroid-frame figcaption {
  position: relative;
  margin: 10px 0 0;
  padding-top: 8px;
  min-height: 2.2em;
  text-align: center;
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: #5e5548;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.prose .polaroid-frame figcaption::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: rgba(94, 85, 72, 0.18);
}

.prose .polaroid-frame--left {
  transform: rotate(-3deg) translateY(-8px);
  z-index: 2;
}

.prose .polaroid-frame--right {
  transform: rotate(2.5deg) translateY(10px);
  z-index: 1;
}

.prose .polaroid-pair:nth-of-type(even) .polaroid-frame--left {
  transform: rotate(-1.6deg) translateY(6px);
}

.prose .polaroid-pair:nth-of-type(even) .polaroid-frame--right {
  transform: rotate(3.1deg) translateY(-4px);
}

.dark .prose .polaroid-frame {
  background: #f3f2ee;
  border-color: #d8d4cb;
}

.dark .prose .polaroid-frame figcaption {
  color: #5e5548;
  text-shadow: none;
}

.dark .prose .polaroid-frame figcaption::before {
  background: rgba(84, 75, 64, 0.22);
}

/* Portrait pair – two vertical items side by side in polaroid frames */
.prose .polaroid-pair--portrait {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(0.75rem, 2vw, 1.5rem);
  align-items: end;
  max-width: 520px;
  margin: var(--space-10) auto var(--space-12);
  padding: var(--space-2) 0;
}

.prose .polaroid-pair--portrait .polaroid-frame img,
.prose .polaroid-pair--portrait .polaroid-frame video {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* Sticker / tape style photo */
.prose .photo-sticker {
  position: relative;
  margin: var(--space-10) auto;
  padding: 12px;
  background: #f6f3ec;
  border: 1px solid #e9e3d7;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.16);
  transform: rotate(-1deg);
}

.prose .photo-sticker::before {
  content: "";
  position: absolute;
  top: -16px;
  left: -10px;
  width: 34%;
  height: 30px;
  background: rgba(239, 230, 213, 0.72);
  border: 1px solid rgba(220, 205, 182, 0.55);
  transform: rotate(-18deg);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.07);
  pointer-events: none;
}

.prose .photo-sticker::after {
  content: "";
  position: absolute;
  right: -12px;
  bottom: -16px;
  width: 34%;
  height: 30px;
  background: rgba(239, 230, 213, 0.72);
  border: 1px solid rgba(220, 205, 182, 0.55);
  transform: rotate(-18deg);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.07);
  pointer-events: none;
}

.prose .photo-sticker img {
  margin: 0;
}

/* Fridge-magnet style photo */
.prose .photo-magnet {
  position: relative;
  margin: var(--space-10) auto;
  padding: 14px;
  background: linear-gradient(180deg, #f9fbfd 0%, #eef2f6 100%);
  border: 1px solid #d7dfe8;
  border-radius: var(--radius-md);
  box-shadow:
    0 16px 26px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.prose .photo-magnet::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle at 35% 35%, #f8fbff 0%, #a9b7c8 65%, #7f8da0 100%);
  transform: translateX(-50%);
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.25);
  pointer-events: none;
}

.prose .photo-magnet img {
  margin: 0;
  border-radius: var(--radius-sm);
}

/* Postal stamp style */
.prose .photo-stamp {
  position: relative;
  margin: var(--space-10) auto;
  padding: 12px;
  background: #fcfaf4;
  border: 2px dotted #d7c4a6;
  border-radius: 6px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.prose .photo-stamp::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(137, 116, 86, 0.35);
  pointer-events: none;
}

.prose .photo-stamp img {
  margin: 0;
  border-radius: 2px;
}

/* Film negative style */
.prose .photo-film {
  position: relative;
  margin: var(--space-10) auto;
  padding: 14px 26px;
  background: #15171c;
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 30px rgba(6, 10, 20, 0.35);
}

.prose .photo-film::before,
.prose .photo-film::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 10px;
  background: repeating-linear-gradient(
    to bottom,
    #d9dce2 0 10px,
    transparent 10px 18px
  );
  opacity: 0.9;
}

.prose .photo-film::before {
  left: 8px;
}

.prose .photo-film::after {
  right: 8px;
}

.prose .photo-film img {
  margin: 0;
  border-radius: 2px;
}

/* Travel tag style: <figure class="photo-tag" data-tag="Antwerp · 2025"> */
.prose .photo-tag {
  position: relative;
  margin: var(--space-10) auto;
  padding: 10px;
  background: #f9f7f1;
  border: 1px solid #ded7ca;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.prose .photo-tag::after {
  content: attr(data-tag);
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(27, 42, 70, 0.8);
  color: #f7f8fa;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.prose .photo-tag img {
  margin: 0;
}

/* Coordinates style: <figure class="photo-coords" data-coords="51.22N, 4.40E"> */
.prose .photo-coords {
  position: relative;
  margin: var(--space-10) auto;
  padding: 8px 8px 36px;
  background: #fff;
  border: 1px solid #ddd7cc;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.prose .photo-coords::after {
  content: "📍 " attr(data-coords);
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #5b6778;
}

.prose .photo-coords img {
  margin: 0;
}

/* Handwritten callouts:
   <figure class="photo-annotated">
     <img ...>
     <span class="photo-note photo-note--top-left">这里</span>
   </figure>
*/
.prose .photo-annotated {
  position: relative;
  margin: var(--space-10) auto;
}

.prose .photo-annotated .photo-note {
  position: absolute;
  padding: 2px 8px;
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: #2f3f5d;
  background: rgba(248, 244, 229, 0.85);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.prose .photo-annotated .photo-note--top-left {
  top: 8px;
  left: 8px;
}

.prose .photo-annotated .photo-note--bottom-right {
  right: 8px;
  bottom: 8px;
}

/* Ticket collage style */
.prose .photo-ticket {
  position: relative;
  margin: var(--space-10) auto;
  padding: 10px;
  background: #f8f6f1;
  border: 1px solid #dfd7ca;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.prose .photo-ticket::after {
  content: attr(data-ticket);
  position: absolute;
  right: -8px;
  bottom: -10px;
  padding: 6px 10px;
  border: 1px dashed #bda986;
  background: #f9ebcc;
  color: #7a5d2f;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  transform: rotate(-7deg);
  box-shadow: 0 6px 10px rgba(15, 23, 42, 0.1);
}

.prose .photo-ticket img {
  margin: 0;
}

/* Double frame style */
.prose .photo-double-border {
  margin: var(--space-10) auto;
  padding: 8px;
  border: 1px solid #d3c8b8;
  outline: 1px solid #f9f5ed;
  outline-offset: -4px;
  background: #f8f4ec;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.prose .photo-double-border img {
  margin: 0;
  border-radius: 0;
}

/* Hover float style */
.prose .photo-hover-float {
  transition: transform var(--duration-slow) ease, box-shadow var(--duration-slow) ease;
}

/* Handwritten captions for decorated frames except film */
.prose figure[class*="photo-"]:not(.photo-film) figcaption {
  margin-top: var(--space-3);
  text-align: center;
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;
  font-size: clamp(1rem, 2.2vw, 1.28rem);
  color: #5e5548;
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.prose .photo-film figcaption {
  margin-top: var(--space-3);
  text-align: center;
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;
  font-size: clamp(1rem, 2.2vw, 1.28rem);
  color: #f3e8d1;
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-wrap: balance;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    0 0 6px rgba(255, 228, 186, 0.2);
}

/* Washi tape photo style */
.prose .photo-washi {
  position: relative;
  margin: var(--space-10) auto;
  padding: 10px;
  background: #f8f6f1;
  border: 1px solid #e9e3d7;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.13);
  transform: rotate(0.8deg);
}

.prose .photo-washi::before,
.prose .photo-washi::after {
  content: '';
  position: absolute;
  height: 24px;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: multiply;
}

/* Top tape - warm yellow with torn edges */
.prose .photo-washi::before {
  top: -13px;
  left: 12%;
  width: 65px;
  background:
    linear-gradient(90deg, transparent 0px, rgba(253, 205, 96, 0.5) 3px, rgba(253, 205, 96, 0.5) calc(100% - 3px), transparent 100%),
    repeating-linear-gradient(135deg, rgba(255, 220, 130, 0.3) 0px, rgba(255, 220, 130, 0.3) 2px, transparent 2px, transparent 5px);
  border-top: 1px solid rgba(220, 180, 80, 0.2);
  border-bottom: 1px solid rgba(220, 180, 80, 0.2);
  transform: rotate(-6deg);
}

/* Bottom tape - soft pink/mauve */
.prose .photo-washi::after {
  bottom: -11px;
  right: 10%;
  width: 58px;
  background:
    linear-gradient(90deg, transparent 0px, rgba(210, 170, 180, 0.5) 3px, rgba(210, 170, 180, 0.5) calc(100% - 3px), transparent 100%),
    repeating-linear-gradient(135deg, rgba(220, 180, 190, 0.3) 0px, rgba(220, 180, 190, 0.3) 2px, transparent 2px, transparent 5px);
  border-top: 1px solid rgba(190, 150, 160, 0.2);
  border-bottom: 1px solid rgba(190, 150, 160, 0.2);
  transform: rotate(4deg);
}

/* Alternate washi colors for variety */
.prose .photo-washi:nth-of-type(even)::before {
  background:
    linear-gradient(90deg, transparent 0px, rgba(160, 200, 180, 0.5) 3px, rgba(160, 200, 180, 0.5) calc(100% - 3px), transparent 100%),
    repeating-linear-gradient(135deg, rgba(170, 210, 190, 0.3) 0px, rgba(170, 210, 190, 0.3) 2px, transparent 2px, transparent 5px);
  border-color: rgba(130, 170, 150, 0.2);
  left: auto;
  right: 18%;
  transform: rotate(7deg);
}

.prose .photo-washi:nth-of-type(even)::after {
  background:
    linear-gradient(90deg, transparent 0px, rgba(175, 188, 230, 0.5) 3px, rgba(175, 188, 230, 0.5) calc(100% - 3px), transparent 100%),
    repeating-linear-gradient(135deg, rgba(180, 193, 235, 0.3) 0px, rgba(180, 193, 235, 0.3) 2px, transparent 2px, transparent 5px);
  border-color: rgba(145, 158, 200, 0.2);
  right: auto;
  left: 15%;
  transform: rotate(-5deg);
}

.prose .photo-washi:nth-of-type(even) {
  transform: rotate(-0.6deg);
}

.prose .photo-washi img {
  margin: 0;
}

.prose .photo-washi figcaption {
  position: relative;
}

.dark .prose .photo-washi {
  background: #f3eee5;
  border-color: #d5ccbc;
}

/* Paper clip photo style */
.prose .photo-clip {
  position: relative;
  margin: var(--space-10) auto;
  padding: 10px;
  background: #f8f6f1;
  border: 1px solid #e9e3d7;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.prose .photo-clip::before {
  content: '';
  position: absolute;
  top: -14px;
  right: 24px;
  width: 20px;
  height: 42px;
  border: 2.5px solid #b0a898;
  border-radius: 10px 10px 4px 4px;
  background: transparent;
  z-index: 2;
  pointer-events: none;
  transform: rotate(5deg);
}

.prose .photo-clip::after {
  content: '';
  position: absolute;
  top: -6px;
  right: 28px;
  width: 12px;
  height: 22px;
  border: 2px solid #c4b8a8;
  border-radius: 6px 6px 2px 2px;
  border-top: none;
  background: #f8f6f1;
  z-index: 3;
  pointer-events: none;
  transform: rotate(5deg);
}

.prose .photo-clip img {
  margin: 0;
}

.dark .prose .photo-clip {
  background: #f3eee5;
  border-color: #d5ccbc;
}

.dark .prose .photo-clip::before {
  border-color: var(--travel-muted);
}

.dark .prose .photo-clip::after {
  border-color: #a09484;
  background: #f3eee5;
}

/* Handwritten underline for travel captions */
.travel-content .prose figure[class*="photo-"] figcaption,
.travel-content .prose .polaroid-frame figcaption {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 4'%3E%3Cpath d='M0 2 Q15 0.5 30 2.5 Q50 4 70 1.5 Q85 0 100 2' fill='none' stroke='%23c8bfb2' stroke-width='0.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 70% 4px;
  padding-bottom: 8px;
}

.dark .travel-content .prose figure[class*="photo-"] figcaption,
.dark .travel-content .prose .polaroid-frame figcaption {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 4'%3E%3Cpath d='M0 2 Q15 0.5 30 2.5 Q50 4 70 1.5 Q85 0 100 2' fill='none' stroke='%236b5f52' stroke-width='0.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Corner mount photo style */
.prose .photo-corners {
  position: relative;
  margin: var(--space-10) auto;
  padding: 16px;
  background: transparent;
}

.prose .photo-corners img {
  margin: 0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.prose .photo-corners .corner {
  position: absolute;
  width: 20px;
  height: 20px;
  z-index: 2;
}

.prose .photo-corners .corner::before,
.prose .photo-corners .corner::after {
  content: '';
  position: absolute;
  background: #d4c4a8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.prose .photo-corners .corner-tl {
  top: 6px;
  left: 6px;
}

.prose .photo-corners .corner-tl::before {
  width: 20px;
  height: 3px;
  top: 0;
  left: 0;
  transform: rotate(45deg);
  transform-origin: left center;
}

.prose .photo-corners .corner-tl::after {
  width: 3px;
  height: 20px;
  top: 0;
  left: 0;
  transform: rotate(45deg);
  transform-origin: top center;
}

.prose .photo-corners .corner-tr {
  top: 6px;
  right: 6px;
}

.prose .photo-corners .corner-tr::before {
  width: 20px;
  height: 3px;
  top: 0;
  right: 0;
  transform: rotate(-45deg);
  transform-origin: right center;
}

.prose .photo-corners .corner-tr::after {
  width: 3px;
  height: 20px;
  top: 0;
  right: 0;
  transform: rotate(-45deg);
  transform-origin: top center;
}

.prose .photo-corners .corner-bl {
  bottom: 6px;
  left: 6px;
}

.prose .photo-corners .corner-bl::before {
  width: 20px;
  height: 3px;
  bottom: 0;
  left: 0;
  transform: rotate(-45deg);
  transform-origin: left center;
}

.prose .photo-corners .corner-bl::after {
  width: 3px;
  height: 20px;
  bottom: 0;
  left: 0;
  transform: rotate(-45deg);
  transform-origin: bottom center;
}

.prose .photo-corners .corner-br {
  bottom: 6px;
  right: 6px;
}

.prose .photo-corners .corner-br::before {
  width: 20px;
  height: 3px;
  bottom: 0;
  right: 0;
  transform: rotate(45deg);
  transform-origin: right center;
}

.prose .photo-corners .corner-br::after {
  width: 3px;
  height: 20px;
  bottom: 0;
  right: 0;
  transform: rotate(45deg);
  transform-origin: bottom center;
}

.dark .prose .photo-corners .corner::before,
.dark .prose .photo-corners .corner::after {
  background: #a89878;
}

/* Video embed */
.prose .video-embed {
  margin: var(--space-8) auto;
  max-width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.prose .video-embed iframe,
.prose .video-embed video {
  display: block;
  width: 100%;
  border: none;
}
.prose .video-embed--vertical {
  max-width: 320px;
}
.prose .video-embed--vertical iframe,
.prose .video-embed--vertical video {
  aspect-ratio: 9 / 16;
}

/* External video link card */
.prose .video-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: var(--space-6) auto;
  max-width: 360px;
  padding: 14px 20px;
  background: #f8f7f3;
  border: 1px solid #ebe7e0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: #5e5548;
  transition: transform var(--duration-base) ease, box-shadow var(--duration-base) ease;
}
.prose .video-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.prose .video-link__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #e8e4dc;
  border-radius: 50%;
  font-size: 14px;
  color: #5e5548;
}
.prose .video-link__text {
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  line-height: 1.3;
}
.dark .prose .video-link {
  background: var(--travel-bg);
  border-color: #3d3730;
  color: #d4cdc4;
}
.dark .prose .video-link__icon {
  background: #3d3730;
  color: #d4cdc4;
}

/* Timeline album style */
.prose .photo-timeline {
  margin: var(--space-12) 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: var(--space-8);
}

.prose .photo-time-item {
  position: relative;
  padding-left: 22px;
}

.prose .photo-time-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #8aa0bf;
}

.prose .photo-time-item::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: -14px;
  width: 2px;
  background: linear-gradient(180deg, rgba(138, 160, 191, 0.55), rgba(138, 160, 191, 0.05));
}

.prose .photo-time-item:last-child::after {
  display: none;
}

.prose .photo-time-label {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  letter-spacing: 0.08em;
}

.dark .prose .photo-sticker {
  background: #f3eee5;
  border-color: #d5ccbc;
}

.dark .prose .photo-magnet {
  background: linear-gradient(180deg, #f0f3f6 0%, #e2e8ef 100%);
  border-color: #b9c3cf;
}

.dark .prose .photo-stamp {
  background: #f1eee7;
  border-color: #cbbca7;
}

.dark .prose figure[class*="photo-"]:not(.photo-film) figcaption {
  color: #5e5548;
  text-shadow: none;
}

.dark .prose .photo-tag {
  background: #ede8dd;
  border-color: #cfc6b8;
}

.dark .prose .photo-coords {
  background: #ece8df;
  border-color: #cfc7ba;
}

.dark .prose .photo-note {
  background: rgba(243, 236, 220, 0.9);
  color: #2a3752;
}

.dark .prose .photo-ticket {
  background: #efe9de;
  border-color: #cfc4b3;
}

.dark .prose .photo-ticket::after {
  background: #f3e2bf;
}

.dark .prose .photo-double-border {
  background: #eee6da;
  border-color: #c6b9a6;
}

.dark .prose .polaroid-frame,
.dark .prose .photo-sticker,
.dark .prose .photo-magnet,
.dark .prose .photo-stamp,
.dark .prose .photo-film,
.dark .prose .photo-tag,
.dark .prose .photo-coords,
.dark .prose .photo-ticket,
.dark .prose .photo-double-border {
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 24px rgba(158, 182, 214, 0.22);
}

@media (hover: hover) {
  .prose .photo-hover-float:hover {
    transform: translateY(-5px) rotate(-0.35deg);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.18);
  }

  .dark .prose .photo-hover-float:hover {
    box-shadow:
      0 28px 48px rgba(0, 0, 0, 0.66),
      0 0 0 1px rgba(255, 255, 255, 0.28),
      0 0 30px rgba(158, 182, 214, 0.28);
  }
}

@media (max-width: 768px) {
  .prose .polaroid-pair,
  .prose .polaroid-pair--portrait {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .prose .polaroid-pair--portrait {
    max-width: 280px;
  }

  .prose .polaroid-frame--left,
  .prose .polaroid-frame--right {
    transform: none;
  }

  .prose .photo-sticker {
    transform: none;
  }

  .prose .photo-ticket::after {
    right: 6px;
    bottom: 6px;
    transform: none;
  }

  .prose .photo-time-item {
    padding-left: 18px;
  }
}

/* Video Embeds */
.prose .video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin: var(--space-8) 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.prose .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.prose figure {
  margin: var(--space-10) 0;
  text-align: center;
}

.prose figcaption {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  text-align: center;
  margin-top: var(--space-3);
}

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', sans-serif;
  font-size: var(--text-sm);
  display: block;
  overflow-x: auto;
}

.prose th, .prose td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.prose th {
  font-weight: 600;
  background: var(--color-border-light);
}

/* Horizontal Rule — three-dot ornament */
.prose hr {
  border: none;
  height: auto;
  background: none;
  margin: var(--space-12) 0;
  text-align: center;
  overflow: visible;
}

.prose hr::before {
  content: '· · ·';
  display: block;
  letter-spacing: 0.5em;
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
}

/* ============================================
   Math (KaTeX)
   ============================================ */

.prose .katex-display {
  margin: var(--space-6) 0;
  overflow-x: auto;
}

/* ============================================
   Article Footer (Navigation)
   ============================================ */

.article-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-16);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.nav-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  padding: var(--space-4);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--duration-slow) var(--ease-bounce);
}

.nav-link:hover {
  border-color: var(--color-accent);
  background: rgba(14, 124, 149, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.dark .nav-link:hover {
  background: rgba(61, 189, 224, 0.08);
  box-shadow: var(--shadow-accent);
}

.nav-link.next {
  text-align: right;
  align-items: flex-end;
  grid-column: 2;
}

.nav-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-1);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-link .nav-title {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
}

/* ============================================
   Site Footer
   ============================================ */

.site-footer {
  margin-top: var(--space-24);
  position: relative;
  z-index: 3;
}

/* ── Footer Wave Separator ── */
.footer-wave {
  position: relative;
  width: 100%;
  height: 48px;
  overflow: hidden;
  line-height: 0;
}

.footer-wave-svg {
  display: block;
  width: 200%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.footer-wave-back-svg {
  animation: waveSlide 8s ease-in-out infinite alternate;
}

.footer-wave-front-svg {
  animation: waveSlide 6s ease-in-out infinite alternate-reverse;
}

.footer-wave-back {
  fill: #ebe5dc;
}

.footer-wave-front {
  fill: #f5f1ec;
}

.dark .footer-wave-back {
  fill: #362f28;
}

.dark .footer-wave-front {
  fill: #2c2722;
}

@keyframes waveSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .footer-wave-back-svg,
  .footer-wave-front-svg {
    animation: none !important;
  }
}

/* Main footer area */
.footer-main {
  position: relative;
  background: #f5f1ec;
  border-top: none;
}

.dark .footer-main {
  background: #2c2722;
  border-top: none;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
}

/* Navigation links */
.footer-nav {
  display: flex;
  gap: var(--space-8);
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: #706860;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  transition: color var(--duration-base);
}

.dark .footer-nav a {
  color: #b0a494;
}

.footer-nav a:hover {
  color: #5a5248;
}

.dark .footer-nav a:hover {
  color: #ddd2c4;
}

/* Brand element */
.footer-brand {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  user-select: none;
}

.footer-brand-name {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: 0.08em;
  /* inline-grid: both children share the same grid cell,
     stacking them pixel-perfectly without absolute positioning */
  display: inline-grid;
}

/* Ghost outline base layer */
.footer-brand-stroke {
  grid-column: 1;
  grid-row: 1;
  color: transparent;
  -webkit-text-stroke: 1px #cec5ba;
}

.dark .footer-brand-stroke {
  -webkit-text-stroke-color: #4a433b;
}

/* Laser sweep fill layer — injected by animations.js */
.footer-brand-fill {
  grid-column: 1;
  grid-row: 1;
  color: #8a8074;
  -webkit-text-stroke: 0px;
  animation: footer-brand-laser 3s ease-in-out infinite;
}

.dark .footer-brand-fill {
  color: #8a7e70;
}

@keyframes footer-brand-laser {
  0%   { clip-path: inset(0 0 100% 0); }
  50%  { clip-path: inset(0 0 0% 0);   }
  100% { clip-path: inset(100% 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .footer-brand-fill {
    animation: none;
    clip-path: inset(0 0 0% 0);
  }
}

.footer-brand-desc {
  font-family: var(--font-serif);
  font-size: var(--text-xs);
  color: #706860;
  letter-spacing: 0.12em;
  font-style: italic;
}

.dark .footer-brand-desc {
  color: #a89a8c;
}

/* Bottom bar */
.footer-bottom {
  background: #ece7e0;
  border-top: 1px solid #dfd9d0;
  padding: var(--space-2) var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.dark .footer-bottom {
  background: #231f1b;
  border-top-color: #3a332b;
}


.footer-bottom span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #685e56;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  user-select: none;
}

.dark .footer-bottom span {
  color: #9a8e80;
}

/* Footer responsive */
@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-10);
    padding: var(--space-8) var(--space-6);
  }

  .footer-nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-6);
  }

  .footer-brand {
    text-align: center;
  }
}

/* ============================================
   About Page
   ============================================ */

.about-page {
  max-width: 500px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-6) var(--space-20);
}

/* Calling Card */
.about-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  border-left: 1px solid rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  border-right: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: 0 4px 12px -2px rgba(43, 42, 39, 0.05);
  padding: var(--space-10) var(--space-8);
  margin-bottom: var(--space-12);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  overflow: hidden;
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(43, 42, 39, 0.08), 0 4px 8px -2px rgba(43, 42, 39, 0.04);
}

.dark .about-card {
  background: var(--color-surface);
  border-top-color: rgba(255, 255, 255, 0.06);
  border-left-color: rgba(255, 255, 255, 0.06);
  border-bottom-color: rgba(0, 0, 0, 0.15);
  border-right-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.2);
}

.dark .about-card:hover {
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.3), 0 4px 8px -2px rgba(0, 0, 0, 0.15);
}

/* Holographic foil shimmer */
.about-card-foil {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 40%,
    rgba(41, 166, 201, 0.12) 50%,
    rgba(139, 92, 246, 0.08) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 200%;
  animation: holoShift 6s ease infinite;
}

.dark .about-card-foil {
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.03) 40%,
    rgba(76, 201, 232, 0.08) 50%,
    rgba(177, 154, 252, 0.06) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 200%;
}

@keyframes holoShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Intro */
.about-intro {
  text-align: center;
  margin: 0 auto var(--space-8);
  position: relative;
}

.about-intro p {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 2;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-2);
}

.about-intro p:last-child {
  margin-bottom: 0;
}

/* Focus Areas */
.about-focus {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin: var(--space-6) auto var(--space-8);
  flex-wrap: wrap;
}

.about-focus-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.about-focus-item svg {
  color: var(--color-accent);
  flex-shrink: 0;
}

/* Stats */
.about-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border-light);
  position: relative;
}

.about-stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.about-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-tertiary);
}

.about-stat-number {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}

.about-stat-sep {
  width: 1px;
  height: 32px;
  background: var(--color-border-light);
}

/* Contact */
.about-contact {
  text-align: center;
}

.about-contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.about-contact-link,
.about-contact-location {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color var(--duration-base);
}

.about-contact-link:hover {
  color: var(--color-accent);
}

.about-contact-link svg,
.about-contact-location svg {
  opacity: 0.5;
  flex-shrink: 0;
}

.about-contact-sep {
  width: 1px;
  height: 14px;
  background: var(--color-border-light);
}

/* Quote */
.about-quote {
  text-align: center;
  margin-top: var(--space-16);
}

.about-quote p {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text-tertiary);
  letter-spacing: 0.1em;
  margin: 0;
  opacity: 0.6;
}

/* About responsive */
@media (max-width: 640px) {
  .about-page {
    padding: var(--space-10) var(--space-4) var(--space-16);
  }

  .about-card {
    padding: var(--space-8) var(--space-6);
  }

  .about-stats {
    gap: var(--space-6);
  }

  .about-stat-number {
    font-size: 1.25rem;
  }
}

/* ============================================
   Syntax Highlighting (Rouge)
   ============================================ */

.highlight .c, .highlight .c1, .highlight .cm { color: #6a737d; }
.highlight .k, .highlight .kd, .highlight .kn { color: #d73a49; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #032f62; }
.highlight .n, .highlight .nf, .highlight .nc { color: #6f42c1; }
.highlight .mi, .highlight .mf { color: #005cc5; }
.highlight .o, .highlight .p { color: var(--color-text); }

.dark .highlight .c, .dark .highlight .c1, .dark .highlight .cm { color: #6a737d; }
.dark .highlight .k, .dark .highlight .kd, .dark .highlight .kn { color: #ff7b72; }
.dark .highlight .s, .dark .highlight .s1, .dark .highlight .s2 { color: #a5d6ff; }
.dark .highlight .n, .dark .highlight .nf, .dark .highlight .nc { color: #d2a8ff; }
.dark .highlight .mi, .dark .highlight .mf { color: #79c0ff; }

/* ============================================
   404 Error Page
   ============================================ */

.error-page {
  text-align: center;
  padding: var(--space-20) 0;
  max-width: var(--content-width);
  margin: 0 auto;
}

.error-code {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 700;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: var(--space-4);
}

.error-message {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.error-description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

.error-link {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  background: var(--color-accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: background var(--duration-base);
}

.error-link:hover {
  background: var(--color-accent-hover);
}

/* ============================================
   Search Page
   ============================================ */

.search-page {
  max-width: var(--content-width);
  margin: 0 auto;
}

.search-container {
  margin-bottom: var(--space-10);
}

.search-input {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-lg);
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--duration-base);
}

.search-input:focus {
  border-color: var(--color-accent);
}

.search-input::placeholder {
  color: var(--color-text-tertiary);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-hint,
.search-no-results {
  text-align: center;
  color: var(--color-text-tertiary);
  padding: var(--space-10);
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-border-light);
  text-decoration: none;
  transition: background var(--duration-base);
}

.search-result-item:hover .search-result-title {
  color: var(--color-accent);
}

.search-result-date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}

.search-result-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  transition: color var(--duration-base);
}

.search-result-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
}

/* ============================================
   Social Sharing
   ============================================ */

.share-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-light);
}

.share-label {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.share-buttons {
  display: flex;
  gap: var(--space-2);
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  background: var(--color-surface);
  cursor: pointer;
  transition: all var(--duration-base);
}

.share-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.share-btn.copied {
  border-color: #22c55e;
  color: #22c55e;
}

/* Travel journal share & footer overrides */
.travel-page .share-section {
  border-top: 1px dashed #d8d0c4;
}

.travel-page .share-label {
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;
  font-size: var(--text-base);
  color: var(--travel-muted);
  letter-spacing: 0.05em;
}

.travel-page .share-btn {
  background: var(--travel-bg);
  border: 1px solid #e0d8ca;
  border-radius: 2px;
  color: var(--travel-muted);
}

.travel-page .share-btn:hover {
  background: #f5f0e8;
  border-color: #c8bfb2;
  color: #5e5548;
}

.travel-page .article-footer {
  border-top: 1px dashed #d8d0c4;
}

.travel-page .nav-link {
  background: var(--travel-bg);
  border: 1px solid #e0d8ca;
  border-radius: 2px;
}

.travel-page .nav-link:hover {
  background: #f5f0e8;
  border-color: #c8bfb2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.travel-page .nav-label {
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;
  font-size: var(--text-sm);
  color: #6b6054;
  text-transform: none;
  letter-spacing: 0.05em;
}

.travel-page .nav-title {
  font-family: 'LXGW WenKai TC', cursive;
  color: #5e5548;
}

.dark .travel-page .share-section {
  border-top-color: var(--travel-border);
}

.dark .travel-page .share-label {
  color: var(--travel-muted);
}

.dark .travel-page .share-btn {
  background: var(--travel-bg);
  border-color: var(--travel-border);
  color: var(--travel-muted);
}

.dark .travel-page .share-btn:hover {
  background: #35302a;
  border-color: #5e5548;
  color: #c8bfb2;
}

.dark .travel-page .article-footer {
  border-top-color: var(--travel-border);
}

.dark .travel-page .nav-link {
  background: var(--travel-bg);
  border-color: var(--travel-border);
}

.dark .travel-page .nav-link:hover {
  background: #35302a;
  border-color: #5e5548;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dark .travel-page .nav-label {
  color: var(--travel-muted);
}

.dark .travel-page .nav-title {
  color: #c8bfb2;
}

/* ============================================
   Related Posts
   ============================================ */

.related-posts {
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border-light);
}

.related-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.related-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-light);
  text-decoration: none;
  transition: background var(--duration-base);
}

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

.related-item:hover .related-item-title {
  color: var(--color-accent);
}

.related-item-title {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  transition: color var(--duration-base);
}

.related-item-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}


/* ============================================
   View Transitions
   ============================================ */

@view-transition {
  navigation: auto;
}

/* Title transition - smooth movement and scaling */
::view-transition-group(post-title-*) {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
}

::view-transition-old(post-title-*),
::view-transition-new(post-title-*) {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
  /* Prevent flickering by matching heights */
  height: 100%;
  width: 100%;
  object-fit: none;
}

/* Page navigation crossfade (default) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
  animation-timing-function: ease-in-out;
}

::view-transition-old(root) {
  animation-name: fade-out;
}

::view-transition-new(root) {
  animation-name: fade-in;
}

@keyframes fade-out {
  to { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
}

/* Theme toggle circular expansion animation */
:root {
  --theme-toggle-x: 50vw;
  --theme-toggle-y: 0;
  --theme-toggle-radius: 100vmax;
}

/* Theme circle-expand overrides are injected dynamically via JS
   to avoid compound-selector specificity issues with ::view-transition-* on mobile */

@keyframes theme-circle-expand {
  from {
    clip-path: circle(0 at var(--theme-toggle-x) var(--theme-toggle-y));
  }
  to {
    clip-path: circle(var(--theme-toggle-radius) at var(--theme-toggle-x) var(--theme-toggle-y));
  }
}

/* ============================================
   Icon Utilities (Heroicons)
   ============================================ */

/* Navigation Icons - Glossy Hover Effect */
.nav-link-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--space-2);
  position: relative;
  transition: transform 0.3s var(--ease-spring), color var(--duration-base), background var(--duration-base);
}

.nav-link-icon:hover {
  color: var(--color-accent);
  background: rgba(14, 124, 149, 0.08);
  transform: translateY(-2px);
}

.dark .nav-link-icon:hover {
  background: rgba(61, 189, 224, 0.1);
}

.nav-link-icon:active {
  transform: translateY(0);
  transition: transform 0.1s;
}

.nav-link-icon svg {
  flex-shrink: 0;
  transition: transform 0.25s;
}

.nav-link-icon:hover svg {
  animation: iconWobble 0.5s var(--ease-spring);
  transform: scale(1.15);
}

/* Shine effect on hover */
.nav-link-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%,
    transparent 100%
  );
  background-size: 200% 100%;
  background-position: 200% 0;
  opacity: 0;
  transition: opacity var(--duration-slow), background-position 0.5s;
  pointer-events: none;
}

.nav-link-icon:hover::before {
  opacity: 1;
  background-position: -200% 0;
}

/* Card metadata with icons */
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.card-tag svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.card-date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.card-date svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Article date with icon */
.article-date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.article-date svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* Tags with icons */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.tag svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* Navigation arrows */
.nav-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-label svg {
  flex-shrink: 0;
  transition: transform var(--duration-base);
}

.nav-link.prev:hover .nav-label svg {
  transform: translateX(-3px);
}

.nav-link.next:hover .nav-label svg {
  transform: translateX(3px);
}

/* Tag page post date with icon */
.tag-page .post-date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.tag-page .post-date svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Hide nav text on very small screens */
@media (max-width: 480px) {
  .nav-link-icon span {
    display: none;
  }

  .nav-links {
    gap: var(--space-3);
  }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .nav {
    padding: var(--space-3) var(--space-4);
  }

  .nav-links {
    gap: var(--space-4);
  }

  .main {
    padding: var(--space-8) var(--space-4);
  }

  /* cards-grid responsive handled in card-image section */
  .cards-grid {
    gap: var(--space-8);
    gap: var(--space-8);
  }

  .card-title {
    font-size: var(--text-lg);
  }

  .article-title {
    font-size: var(--text-2xl);
  }

  .travel-header-card {
    height: 160px;
  }

  .travel-header-stamp {
    width: 44px;
    height: 44px;
  }

  .travel-stamp-year {
    font-size: 9px;
  }

  .travel-stamp-day {
    font-size: 13px;
  }

  .travel-ratings {
    padding: 16px 18px;
  }

  .travel-rating-label {
    width: 64px;
    font-size: var(--text-sm);
  }

  .travel-rating-stars svg {
    width: 18px;
    height: 18px;
  }

  .article-footer {
    grid-template-columns: 1fr;
  }

  .nav-link.next {
    grid-column: 1;
    text-align: left;
  }

  .prose pre {
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    border-radius: 0;
  }

  .error-code {
    font-size: 4rem;
  }

  .share-section {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }

  .tag-title {
    font-size: var(--text-3xl);
  }
}

/* ============================================
   Back to Top
   ============================================ */

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  box-shadow: var(--shadow-lg);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.back-to-top:active {
  transform: scale(0.9);
  transition: transform 0.1s;
}


/* ============================================
   AI Summary
   ============================================ */

.ai-summary {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  background: rgba(14, 124, 149, 0.1);
  border: 1px solid rgba(14, 124, 149, 0.2);
  border-radius: 20px;
  overflow: hidden;
  width: fit-content;
  transition: width var(--duration-slower) var(--ease-smooth),
              border-radius var(--duration-slower) var(--ease-smooth);
}

.ai-summary.expanded {
  width: 100%;
  border-radius: var(--radius-lg);
}

.ai-summary-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: none;
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: padding var(--duration-slower) var(--ease-smooth);
}

.ai-summary.expanded .ai-summary-trigger {
  padding: var(--space-3) var(--space-5);
}

.ai-summary-trigger:hover {
  background: rgba(14, 124, 149, 0.05);
}

.ai-summary-trigger.loading {
  pointer-events: none;
}

.ai-summary-trigger svg {
  flex-shrink: 0;
}

/* Loading dots animation */
.ai-loading-dots {
  display: inline-flex;
  gap: 3px;
}

.ai-loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  animation: aiDotBounce 1.4s infinite ease-in-out;
}

.ai-loading-dots span:nth-child(1) { animation-delay: 0s; }
.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiDotBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Summary content */
.ai-summary-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--duration-slower) var(--ease-smooth);
}

.ai-summary-content > div {
  overflow: hidden;
}

.ai-summary-content.show {
  grid-template-rows: 1fr;
}

.ai-summary-content-inner {
  padding: 0 var(--space-5) var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* ============================================
   Text Selection Menu
   ============================================ */

.selection-menu {
  position: fixed;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  animation: selectionMenuFadeIn var(--duration-fast) ease;
}

.selection-menu.show {
  display: flex;
}

.selection-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.selection-menu-btn:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.selection-menu-btn svg {
  flex-shrink: 0;
}

.selection-menu-divider {
  width: 1px;
  height: 24px;
  background: var(--color-border);
  margin: 0 4px;
}

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

/* Mobile adjustments */
@media (max-width: 640px) {
  .selection-menu-btn span {
    display: none;
  }

  .selection-menu-btn {
    padding: 10px;
  }
}

/* ============================================
   Travel Journal Page
   ============================================ */

.travels-page {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.travels-foreground {
  position: relative;
  z-index: 2;
  padding-top: var(--space-8);
  padding-bottom: var(--space-12);
}

/* Globe Background */
.travels-page .globe-hero {
  position: fixed;
  inset: 68px 0 0 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, #b8d4e8 0%, #dce8f0 35%, var(--color-bg) 70%);
}

.dark .travels-page .globe-hero {
  background: radial-gradient(ellipse at 50% 40%, #1a2a3a 0%, #141e28 35%, var(--color-bg) 70%);
}

.travels-page .globe-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg, rgba(250, 250, 250, 0.48) 0%, rgba(250, 250, 250, 0.66) 34%, rgba(250, 250, 250, 0.82) 100%);
  z-index: 1;
}

.dark .travels-page .globe-hero::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(180, 219, 255, 0.16) 0%, rgba(180, 219, 255, 0) 46%),
    linear-gradient(180deg, rgba(16, 21, 28, 0.36) 0%, rgba(16, 21, 28, 0.58) 34%, rgba(16, 21, 28, 0.74) 100%);
}

.travels-page .globe-container {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.travels-page .globe-container.loaded {
  opacity: 1;
}

/* Loading shimmer while globe tiles load */
.travels-page .globe-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 45%, var(--color-border-light) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--duration-slow) ease;
}

.travels-page .globe-hero.loading::after {
  opacity: 1;
  animation: globeShimmer 1.8s ease-in-out infinite;
}

@keyframes globeShimmer {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.travels-page .cards-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--radius-md);
  border: 1px solid rgba(210, 198, 178, 0.5);
  background-color: var(--travel-bg);
  background-image: radial-gradient(circle, rgba(180, 168, 148, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.dark .travels-page .cards-section {
  border-color: var(--travel-border);
  background-color: var(--travel-bg);
  background-image: radial-gradient(circle, rgba(120, 108, 88, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Globe toggle - slider style matching theme toggle */
.globe-toggle {
  --gt-item: 26px;
  --gt-gap: 2px;
  --gt-pad: 3px;
  margin-left: var(--space-3);
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

.globe-toggle__track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, var(--gt-item));
  gap: var(--gt-gap);
  padding: var(--gt-pad);
  border-radius: var(--radius-full);
  background: #f1f5f9;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .globe-toggle__track {
  background: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.6),
    inset 0 -1px 1px rgba(255, 255, 255, 0.05),
    0 1px 2px rgba(255, 255, 255, 0.08);
}

.globe-toggle__indicator {
  position: absolute;
  top: var(--gt-pad);
  left: var(--gt-pad);
  width: var(--gt-item);
  height: var(--gt-item);
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s var(--ease-bounce);
  z-index: 0;
}

.globe-toggle.active .globe-toggle__indicator {
  transform: translateX(calc(var(--gt-item) + var(--gt-gap)));
}

.dark .globe-toggle__indicator {
  background: linear-gradient(180deg, #454545 0%, #2a2a2a 100%);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.globe-toggle__option {
  height: var(--gt-item);
  width: var(--gt-item);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  color: #94a3b8;
  transition: color var(--duration-base);
}

.dark .globe-toggle__option {
  color: #606060;
}

.globe-toggle.active .globe-toggle__on {
  color: var(--color-accent);
}

.dark .globe-toggle.active .globe-toggle__on {
  color: #efefef;
}

/* When globe is off, make cards opaque */
.travels-page.globe-off .cards-section {
  background-color: var(--travel-bg);
  border-color: rgba(210, 198, 178, 0.6);
}

.dark .travels-page.globe-off .cards-section {
  background-color: var(--travel-bg);
  border-color: var(--travel-border);
}

.travels-page .section-title {
  font-size: var(--text-xl);
  letter-spacing: 0.08em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 4'%3E%3Cpath d='M0 2 Q15 0.5 30 2.5 Q50 4 70 1.5 Q85 0 100 2' fill='none' stroke='%23c8bfb2' stroke-width='0.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 80% 4px;
  padding-bottom: 6px;
}

.travels-page .globe-stat {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  margin-left: auto;
}

.travels-page .globe-stat-number {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-accent);
}

.travels-page .globe-stat-label {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

/* Travel Diary List — Journal Grid */
.travel-diary-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 4vw, 3rem);
  padding-top: var(--space-4);
}

.travel-diary-item {
  transition: transform var(--duration-normal) ease;
}

/* Scattered rotation for journal feel */
.travel-diary-item:nth-child(odd) {
  transform: rotate(-0.8deg);
}

.travel-diary-item:nth-child(even) {
  transform: rotate(0.6deg);
}

.travel-diary-item:nth-child(4n+1) {
  transform: rotate(-1.2deg) translateY(8px);
}

.travel-diary-item:nth-child(4n+3) {
  transform: rotate(0.4deg) translateY(-6px);
}

/* Polaroid card link */
.travel-diary-link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
  color: inherit;
  padding: 12px 12px 16px;
  border-radius: 2px;
  background: #f8f7f3;
  border: 1px solid #ebe7e0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  transition: transform var(--duration-normal) ease, box-shadow var(--duration-normal) ease;
}

.travel-diary-link:hover {
  transform: translateY(-4px) rotate(0deg);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.15);
  background: #f8f7f3;
}

.dark .travel-diary-link {
  background: #f3f2ee;
  border-color: #d8d4cb;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.dark .travel-diary-link:hover {
  background: #f5f4f0;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.22);
}

/* Highlight animation (triggered by globe click) */
.travel-diary-item.highlighted .travel-diary-link {
  box-shadow: 0 0 0 3px var(--color-accent), 0 8px 20px rgba(15, 23, 42, 0.12);
  animation: travelCardPulse 0.6s ease;
}

.dark .travel-diary-item.highlighted .travel-diary-link {
  box-shadow: 0 0 0 3px var(--color-accent), 0 12px 28px rgba(0, 0, 0, 0.5);
}

@keyframes travelCardPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Thumbnail — large photo filling card width */
.travel-diary-thumb {
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0;
  overflow: hidden;
  background: #f0ece6;
}

.dark .travel-diary-thumb {
  background: #e8e2d8;
}

.travel-diary-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.travel-diary-link:hover .travel-diary-thumb img {
  transform: scale(1.05);
}

/* Body — below photo like a polaroid caption */
.travel-diary-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 10px 4px 4px;
}

.travel-diary-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.travel-diary-title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.4;
  color: #3a3530;
  margin: 0;
  transition: color var(--duration-normal) ease;
}

.travel-diary-link:hover .travel-diary-title {
  color: var(--color-accent);
}

.travel-diary-location {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #9a8e7e;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.travel-diary-desc {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  color: #5e5548;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Date as rubber stamp label */
.travel-diary-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: rgba(90, 78, 62, 0.7);
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border: 1.5px solid rgba(90, 78, 62, 0.25);
  border-radius: 2px;
  transform: rotate(-2deg);
  margin-top: var(--space-1);
  align-self: flex-start;
}

/* Washi tape decorations on alternating cards */
.travel-diary-item:nth-child(3n+1) .travel-diary-link::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 15%;
  width: 60px;
  height: 22px;
  background:
    linear-gradient(90deg, transparent 0px, rgba(253, 205, 96, 0.45) 3px, rgba(253, 205, 96, 0.45) calc(100% - 3px), transparent 100%),
    repeating-linear-gradient(135deg, rgba(255, 220, 130, 0.25) 0px, rgba(255, 220, 130, 0.25) 2px, transparent 2px, transparent 5px);
  border-top: 1px solid rgba(220, 180, 80, 0.15);
  border-bottom: 1px solid rgba(220, 180, 80, 0.15);
  transform: rotate(-5deg);
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.travel-diary-item:nth-child(3n+2) .travel-diary-link::before {
  content: '';
  position: absolute;
  top: -9px;
  right: 12%;
  left: auto;
  width: 55px;
  height: 22px;
  background:
    linear-gradient(90deg, transparent 0px, rgba(160, 200, 180, 0.45) 3px, rgba(160, 200, 180, 0.45) calc(100% - 3px), transparent 100%),
    repeating-linear-gradient(135deg, rgba(170, 210, 190, 0.25) 0px, rgba(170, 210, 190, 0.25) 2px, transparent 2px, transparent 5px);
  border-top: 1px solid rgba(130, 170, 150, 0.15);
  border-bottom: 1px solid rgba(130, 170, 150, 0.15);
  transform: rotate(4deg);
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* ── Map View Mode ── */
.travels-page.map-view .globe-hero {
  z-index: 1;
  pointer-events: auto;
}

.travels-page.map-view .travels-foreground {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.travels-page.map-view .section-header {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(235, 228, 218, 0.5);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  max-width: var(--max-width);
  margin: 0 auto;
}

.dark .travels-page.map-view .section-header {
  background: rgba(22, 24, 30, 0.75);
  border-color: rgba(70, 75, 85, 0.4);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.travels-page.map-view .cards-section {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: var(--space-4) clamp(1.5rem, 4vw, 3rem) 0;
}

.travels-page.map-view .travel-diary-list {
  display: none;
}

.travels-page.map-view .section-line {
  display: none;
}

.travels-page.map-view .travels-quote {
  display: none;
}

/* ── Card Markers on Map ── */
.travel-map-card {
  display: flex;
  flex-direction: column;
  width: 140px;
  background: #f8f7f3;
  border: 1px solid #ebe7e0;
  border-radius: 2px;
  padding: 6px 6px 8px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14), 0 2px 4px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.travel-map-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18), 0 4px 8px rgba(15, 23, 42, 0.1);
}

.travel-map-card.active {
  box-shadow: 0 0 0 3px var(--color-accent), 0 6px 16px rgba(15, 23, 42, 0.14);
}

.dark .travel-map-card {
  background: #f3f2ee;
  border-color: #d8d4cb;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark .travel-map-card:hover {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.25);
}

/* Card pin pointer */
.travel-map-card-pin {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid #f8f7f3;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.08));
}

.dark .travel-map-card-pin {
  border-top-color: #f3f2ee;
}

/* Card image */
.travel-map-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 1px;
  background: #f0ece6;
}

.travel-map-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card body */
.travel-map-card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 2px 2px;
}

.travel-map-card-title {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  color: #3a3530;
  line-height: 1.3;
}

.travel-map-card-location {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #9a8e7e;
  letter-spacing: 0.05em;
}

/* Mapbox controls override */
.travels-page .globe-container .mapboxgl-ctrl-group {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.travels-page .globe-container .mapboxgl-ctrl-group button {
  width: 32px;
  height: 32px;
}

.dark .travels-page .globe-container .mapboxgl-ctrl-group {
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* Globe Fallback (mobile) */
.globe-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--space-4);
}

.globe-fallback-icon {
  color: var(--color-accent);
  opacity: 0.5;
}

.globe-fallback-text {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  letter-spacing: 0.05em;
}

/* Globe fly-to-article transition */
.globe-fly-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.globe-fly-overlay.active {
  opacity: 1;
}

/* Globe overlay gradient hidden in map view */
.travels-page.map-view .globe-hero::before {
  opacity: 0;
}

.travels-quote {
  text-align: center;
  font-style: italic;
  font-family: 'Noto Serif SC', 'Noto Serif TC', Georgia, serif;
  color: #6e6e6e;
  font-size: var(--text-sm);
  letter-spacing: 0.12em;
  margin: var(--space-12) 0 0;
  user-select: none;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.travels-quote::before,
.travels-quote::after {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: var(--color-border);
  flex-shrink: 0;
}

/* Travel Page Responsive */
@media (max-width: 768px) {
  .travels-foreground {
    padding-top: var(--space-4);
  }

  .travels-page .globe-hero {
    inset: 60px 0 0 0;
  }

  .travels-page .cards-section {
    padding: var(--space-4);
    border-radius: var(--radius-sm);
  }

  .travel-diary-list {
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 3vw, 2rem);
  }

  /* Remove rotations on mobile */
  .travel-diary-item:nth-child(n) {
    transform: none;
  }

  .travel-diary-link {
    padding: 10px 10px 14px;
  }

  .travel-diary-thumb {
    aspect-ratio: 16 / 9;
  }

  .travel-diary-title {
    font-size: var(--text-base);
  }

  .travel-diary-desc {
    font-size: 0.95rem;
  }

  /* Remove tape decorations on mobile */
  .travel-diary-item:nth-child(n) .travel-diary-link::before {
    display: none;
  }

  .travel-diary-header {
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-width: 640px) {
  .globe-stat-label {
    display: none;
  }

  .travel-map-card {
    width: 110px;
    padding: 4px 4px 6px;
  }

  .travel-map-card-title {
    font-size: 11px;
  }

  .travel-map-card-location {
    font-size: 8px;
  }

  .travel-map-card-body {
    padding: 4px 2px 1px;
  }
}

/* ============================================
   Photo Location Map
   ============================================ */

.photo-has-location {
  cursor: pointer;
  transition: outline var(--duration-base);
}

.photo-has-location:hover {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Traditional Chinese: replace Ma Shan Zheng with system Kai fonts */
.traditional .prose .polaroid-frame figcaption,
.traditional .prose figure[class*="photo-"]:not(.photo-film) figcaption,
.traditional .prose .photo-film figcaption,
.traditional .prose .photo-annotated .photo-note {
  font-family: 'Kaiti TC', 'BiauKai', 'DFKai-SB', 'KaiTi', 'STKaiti', cursive;
}

.photo-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow);
  backdrop-filter: blur(6px);
}

.photo-map-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.photo-map-modal {
  position: relative;
  width: min(960px, 92vw);
  height: min(600px, 85vh);
  background: var(--color-surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--duration-slow);
}

.photo-map-overlay.show .photo-map-modal {
  transform: scale(1) translateY(0);
}

.photo-map-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  cursor: pointer;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-base);
}

.photo-map-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.photo-map-body {
  display: flex;
  height: 100%;
}

.photo-map-image {
  flex: 1;
  min-width: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-map-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.photo-map-side {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--color-border);
}

.photo-map-info {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.photo-map-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-map-coords {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
  font-family: 'IBM Plex Mono', monospace;
}

.photo-map-container {
  flex: 1;
}

@media (max-width: 768px) {
  .photo-map-modal {
    width: 95vw;
    height: 90vh;
    border-radius: var(--radius-md);
  }

  .photo-map-body {
    flex-direction: column;
  }

  .photo-map-image {
    flex: 1;
    min-height: 0;
  }

  .photo-map-side {
    width: 100%;
    height: 45%;
    flex-shrink: 0;
    border-left: none;
    border-top: 1px solid var(--color-border);
  }
}

/* ============================================
   Dynamic Effects (rootprivacy.com inspired)
   ============================================ */

/* Decrypt text cursor blink */
.decrypt-cursor {
  display: inline-block;
  animation: decrypt-blink 0.7s step-end infinite;
  color: var(--color-accent);
}

@keyframes decrypt-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Card scroll reveal */
@media (prefers-reduced-motion: no-preference) {
  .reveal-pending {
    opacity: 0;
    transition:
      opacity 0.6s var(--ease-smooth) var(--reveal-delay, 0s),
      transform var(--duration-slow) var(--ease-spring);
  }

  .reveal-pending.revealed {
    opacity: 1;
  }
}
