/* === Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.7;
  color: #333;
  background: #fff;
}

/* === Typography === */
h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
}

h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

p {
  margin: 0.5rem 0;
  color: #444;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2rem 0;
}

/* === Hero === */
.hero {
  text-align: center;
}

.profile-photo {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}

.tagline {
  font-size: 1.05rem;
  color: #666;
}

/* === Social Links === */
.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 1rem 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
}

.social-links svg {
  width: 22px;
  height: 22px;
  fill: #555;
  transition: fill 0.2s;
}

.social-links a:hover svg {
  fill: #111;
}

/* === Substack Posts === */
#substack-posts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#substack-posts li {
  margin-bottom: 0.6rem;
  line-height: 1.6;
}

.post-date {
  color: #888;
  font-size: 0.85rem;
  margin-left: 0.75rem;
  white-space: nowrap;
}

.loading {
  color: #999;
}

/* === Timeline === */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #ddd;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  border: 2px solid #fff;
}

.timeline-year {
  display: block;
  color: #888;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.timeline-detail {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.6;
}

/* === Featured List === */
.featured-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.featured-list li {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.featured-source {
  font-size: 0.85rem;
  color: #888;
}

/* === Talks === */
.talks {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.talk-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.talk-thumb {
  width: 200px;
  height: auto;
  border-radius: 4px;
  flex-shrink: 0;
  background: #eee;
}

.talk-info p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #666;
}

/* === Footer === */
footer {
  text-align: center;
  font-size: 0.85rem;
  color: #999;
}

/* === Responsive === */
@media (max-width: 600px) {
  body {
    padding: 24px 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .profile-photo {
    width: 160px;
    height: 160px;
  }

  .timeline-item {
    flex-direction: column;
    gap: 0.15rem;
  }

  .timeline-year {
    width: auto;
  }

  .talk-item {
    flex-direction: column;
  }

  .talk-thumb {
    width: 100%;
    max-width: 320px;
  }
}

/* === Dark Mode === */
@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #e0e0e0;
  }

  p {
    color: #ccc;
  }

  a {
    color: #6db3f2;
  }

  hr {
    border-color: #444;
  }

  .tagline {
    color: #aaa;
  }

  .social-links svg {
    fill: #aaa;
  }

  .social-links a:hover svg {
    fill: #fff;
  }

  .post-date {
    color: #999;
  }

  .loading {
    color: #777;
  }

  .featured-source {
    color: #999;
  }

  .timeline::before {
    background: #444;
  }

  .timeline-item::before {
    background: #aaa;
    border-color: #1a1a1a;
  }

  .timeline-year {
    color: #999;
  }

  .timeline-detail {
    color: #ccc;
  }

  .talk-info p {
    color: #999;
  }

  footer {
    color: #666;
  }

  .profile-photo {
    background: #333;
  }

  .talk-thumb {
    background: #333;
  }
}
