/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica,
    Arial, sans-serif;
  color: #2c2c2c;
  background-color: #fafafa;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #555;
}

img {
  max-width: 100%;
  display: block;
}

main {
  flex: 1;
}

/* ===== Layout Container ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header / Navigation ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #eee;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1a1a1a;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: #555;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background-color: #1a1a1a;
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: #1a1a1a;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #1a1a1a;
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ===== Hero Section ===== */
.hero {
  padding: 100px 0 80px;
  text-align: left;
}

.hero-greeting {
  font-size: 0.875rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #666;
  max-width: 640px;
  line-height: 1.8;
  margin-bottom: 40px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background-color: #1a1a1a;
  color: #fff;
  border: 1px solid #1a1a1a;
}

.btn-primary:hover {
  background-color: #333;
  color: #fff;
}

.btn-secondary {
  background-color: transparent;
  color: #1a1a1a;
  border: 1px solid #d0d0d0;
}

.btn-secondary:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

/* ===== Section Common ===== */
.section {
  padding: 72px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 0.95rem;
  color: #888;
  margin-bottom: 40px;
}

.section-divider {
  width: 40px;
  height: 3px;
  background-color: #d0d0d0;
  border-radius: 2px;
  margin-bottom: 40px;
}

/* ===== Page Header (for sub-pages) ===== */
.page-header {
  padding: 72px 0 40px;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.page-header p {
  font-size: 1rem;
  color: #888;
  max-width: 640px;
}

/* ===== About Section ===== */
.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.about-card {
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 36px 32px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.about-card p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 16px;
}

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

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.tag {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.8rem;
  color: #666;
  background-color: #f5f5f5;
  border-radius: 100px;
  border: 1px solid #e8e8e8;
}

/* ===== Card Grid (Articles & Projects) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 32px 28px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.card-meta {
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
  line-height: 1.5;
}

.card-excerpt {
  font-size: 0.9rem;
  color: #777;
  line-height: 1.7;
  flex: 1;
}

.card-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1a1a1a;
}

.card-link::after {
  content: " →";
}

.card-link:hover {
  color: #555;
}

/* Project card variant */
.card-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.card-tag {
  font-size: 0.75rem;
  color: #888;
  padding: 3px 10px;
  background-color: #f7f7f7;
  border-radius: 100px;
  border: 1px solid #eee;
}

/* Article tag (used in article cards) */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ===== Article Detail ===== */
.article-detail {
  padding: 72px 0 80px;
}

.article-header {
  margin-bottom: 48px;
  max-width: 720px;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.4;
  margin-bottom: 16px;
}

.article-meta {
  font-size: 0.875rem;
  color: #999;
  margin-bottom: 16px;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-body {
  max-width: 720px;
}

.article-body p {
  font-size: 1rem;
  color: #444;
  line-height: 1.9;
  margin-bottom: 20px;
}

.article-body h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-top: 40px;
  margin-bottom: 16px;
}

.article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-top: 32px;
  margin-bottom: 12px;
}

.article-body ul,
.article-body ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.article-body li {
  font-size: 1rem;
  color: #444;
  line-height: 1.9;
  margin-bottom: 8px;
}

.article-body blockquote {
  border-left: 3px solid #d0d0d0;
  padding-left: 20px;
  margin: 24px 0;
  color: #666;
  font-style: italic;
}

.article-body code {
  background-color: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #555;
}

.article-back {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid #eee;
}

.article-back a {
  font-size: 0.9rem;
  color: #555;
}

.article-back a:hover {
  color: #1a1a1a;
}

/* ===== Project Detail (projects page) ===== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.project-item {
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 36px 32px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.project-item h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.project-status {
  display: inline-block;
  font-size: 0.8rem;
  color: #888;
  padding: 3px 12px;
  background-color: #f5f5f5;
  border-radius: 100px;
  border: 1px solid #e8e8e8;
  margin-bottom: 16px;
}

.project-item p {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.8;
  margin-bottom: 12px;
}

.project-item .card-tag-row {
  margin-top: 20px;
}

/* ===== About Page ===== */
.about-page-content {
  max-width: 720px;
}

.about-page-content h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-top: 40px;
  margin-bottom: 16px;
}

.about-page-content p {
  font-size: 1rem;
  color: #555;
  line-height: 1.9;
  margin-bottom: 16px;
}

.about-page-content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.about-page-content li {
  font-size: 1rem;
  color: #555;
  line-height: 1.9;
  margin-bottom: 6px;
}

/* ===== Contact Page ===== */
.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
}

.contact-item {
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 28px 28px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.contact-label {
  font-size: 0.8rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.contact-value {
  font-size: 1rem;
  color: #1a1a1a;
}

.contact-value a {
  color: #1a1a1a;
  border-bottom: 1px solid #d0d0d0;
  padding-bottom: 1px;
}

.contact-value a:hover {
  border-bottom-color: #1a1a1a;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid #eee;
  padding: 40px 0;
  text-align: center;
}

.footer-text {
  font-size: 0.85rem;
  color: #aaa;
  line-height: 1.8;
}

.footer-text a {
  color: #888;
}

.footer-text a:hover {
  color: #555;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: rgba(250, 250, 250, 0.98);
    border-bottom: 1px solid #eee;
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 0;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .hero {
    padding: 64px 0 48px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    text-align: center;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px 0;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .page-header {
    padding: 48px 0 32px;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .article-detail {
    padding: 48px 0 56px;
  }

  .article-header h1 {
    font-size: 1.5rem;
  }

  .project-item {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .about-card {
    padding: 24px 20px;
  }

  .card {
    padding: 24px 20px;
  }

  .contact-item {
    padding: 20px;
  }
}