:root {
  --medium-black: rgba(0, 0, 0, 0.84);
  --medium-dark-gray: rgba(0, 0, 0, 0.68);
  --medium-gray: rgba(0, 0, 0, 0.54);
  --medium-light-gray: rgba(0, 0, 0, 0.34);
  --medium-lighter-gray: rgba(0, 0, 0, 0.15);
  --medium-green: #03a87c;
  --medium-background: #fff;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif Pro", "Noto Serif TC", Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: "Menlo", "Monaco", "Consolas", "Courier New", monospace;
}

/* Base styles */
body {
  font-family: var(--font-serif);
  color: var(--medium-black);
  line-height: 1.6;
  background: var(--medium-background);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.medium-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.75em;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 42px;
  line-height: 1.15;
  margin-top: 0;
  margin-bottom: 0.5em;
}

h2 {
  font-size: 34px;
  line-height: 1.2;
}

h3 {
  font-size: 28px;
  line-height: 1.3;
}

p {
  font-size: 21px;
  line-height: 1.8;
  margin-bottom: 29px;
}

/* Navigation */
.medium-nav {
  border-bottom: 1px solid var(--medium-lighter-gray);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  background: white;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--medium-black);
  text-decoration: none;
}

.nav-brand-logo {
  height: 58px;
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
}

.nav-links {
  display: flex;
}

.nav-links a {
  margin-left: 24px;
  color: var(--medium-gray);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 16px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--medium-black);
}

/* Mark the active navigation link */
.nav-links a.active {
  font-weight: 700;
  border-bottom: 2px solid #0066cc;
}

/* Article styles */
.article-header {
  margin-bottom: 40px;
}

.article-meta {
  display: flex;
  align-items: center;
  margin: 20px 0 30px;
}

.article-author {
  display: flex;
  align-items: center;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 15px;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 500;
  font-size: 16px;
}

.author-date {
  font-size: 14px;
  color: var(--medium-gray);
}

.reading-time {
  color: var(--medium-gray);
  font-size: 14px;
  margin-left: 15px;
}

.article-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  margin-bottom: 30px;
  border-radius: 5px;
}

/* Article content */
.article-content {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.8;
  color: var(--medium-black);
}

.article-content p {
  margin-bottom: 29px;
}

.article-content h2 {
  margin-top: 56px;
}

.article-content img {
  max-width: 100%;
  display: block;
  margin: 42px auto;
}

.article-content blockquote {
  border-left: 3px solid var(--medium-black);
  padding-left: 20px;
  margin-left: 0;
  font-style: italic;
  color: var(--medium-dark-gray);
}

/* Code blocks */
.article-content pre {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  padding: 20px;
  overflow-x: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.5;
  margin: 30px 0;
}

.article-content code {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 15px;
  background: rgba(0, 0, 0, 0.05);
  padding: 3px 5px;
  border-radius: 3px;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* Cards for article listings */
.article-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.article-card {
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
}

.card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-content {
  padding: 25px;
}

.card-title {
  font-size: 22px;
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.3;
}

.card-title a {
  color: var(--medium-black);
  text-decoration: none;
}

.card-excerpt {
  font-size: 16px;
  color: var(--medium-dark-gray);
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--medium-gray);
  font-size: 14px;
}

/* Table of contents */
.chapter-list {
  margin-top: 40px;
}

.chapter-heading {
  font-size: 24px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--medium-lighter-gray);
  padding-bottom: 10px;
}

.topics-list {
  list-style-type: none;
  padding-left: 0;
}

.topic-item {
  margin-bottom: 15px;
}

.topic-link {
  color: var(--medium-black);
  text-decoration: none;
  font-size: 18px;
  display: flex;
  justify-content: space-between;
}

.topic-link:hover {
  color: var(--medium-green);
}

.topic-info {
  color: var(--medium-gray);
  font-size: 14px;
}

/* Reading progress bar */
.progress-container {
  position: fixed;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: 3px;
  background: transparent;
}

.progress-bar {
  height: 3px;
  background: var(--medium-green);
  width: 0%;
}

/* Platform cards styling */
.platform-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin: 2rem 0;
}

.platform-card {
  flex: 1 1 400px;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.platform-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.platform-button {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #0066cc;
  color: white;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.platform-button:hover {
  background-color: #0055aa;
}

.main-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid #eee;
  color: #555;
}

/* About page styles */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.about-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.75rem;
  color: #333;
}

.about-content p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.about-content ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.about-content li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.about-content a {
  color: #0066cc;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.about-content a:hover {
  border-color: #0066cc;
}

/* Responsive */
@media (max-width: 768px) {
  .medium-container {
    padding: 20px 16px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 28px;
  }

  p, .article-content {
    font-size: 18px;
  }

  .article-cards {
    grid-template-columns: 1fr;
  }

  .platform-cards {
    flex-direction: column;
  }
}

section svg {
  display: block;
  /* margin-bottom: 12px; */
}

.about-content h2 svg {
  vertical-align: middle;
  margin-right: 12px;
  display: inline-block;
}

/* Adjust position for mobile */
@media (max-width: 768px) {
  .about-content h2 svg {
    width: 28px;
    height: 28px;
    margin-right: 8px;
  }
}
