/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #2c3e50;
  background: #F2F5F9;
  min-height: 100vh;
}

.logo {
  display: flex;
}

.container {
  max-width: 996px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 12px 0;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: unset;
  padding: 0 16px;
}

header h1 {
  margin: 0;
}

.nav-menu {
  margin: 0;
}

header h1 a {
  color: #2c3e50;
  text-decoration: none;
  transition: color 0.3s ease;
}

header h1 a:hover {
  color: #3498db;
}

header .site-description {
  color: #7f8c8d;
  font-size: 1.1em;
}

.nav-menu {
  position: relative;
}

.nav-menu-desktop ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 36px;
}

.nav-menu a {
  color: #5E5E5E;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-decoration: none;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-menu-toggle {
  box-sizing: border-box;
  display: none;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.nav-menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: #34495e;
  margin: 5px 0;
  transition: 0.3s;
}

.nav-menu-drawer {
  display: none;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  right: 0;
  width: 240px;
  height: 100vh;
  background-color: #fff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  z-index: 1001;
  transform: translateX(100%);
}

.drawer-open .nav-menu-drawer {
  display: block;
  transform: translateX(0);
}

.drawer-content {
  position: relative;
  padding: 40px 6px 12px;
  overflow-y: auto;
  height: 100%;
  background-color: #fff;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-close {
  position: absolute;
  top: 12px;
  right: 6px;
  height: 36px;
  width: 36px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.6);
}

.drawer-open .nav-menu-drawer {
  right: 0;
}

.drawer-open .drawer-overlay {
  opacity: 1;
  visibility: visible;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#loadingIndicator {
  display: flex;
  padding: 8px 0px;
  justify-content: center;
  align-items: center;
  align-self: stretch;
}

#loadingIndicator img {
  animation: spin 1s linear infinite;
}

@media (max-width: 995px) {
  .nav-menu-desktop {
    display: none;
  }

  .nav-menu-toggle {
    display: block;
  }

  .nav-menu-drawer ul {
    list-style: none;
    padding: 0;
  }

  .nav-menu-drawer li {
    display: flex;
    align-items: stretch;
    margin: 16px 0 0;
  }

  .nav-menu-drawer a {
    flex: 1;
    padding: 12px;
    color: #5E5E5E;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    border-radius: 8px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }

  .nav-menu-drawer a:hover {
    background: #F2F5F9;
    color: #4087F7;
  }

  .nav-menu .nav-menu-drawer a::after {
    display: none;
  }
}

.nav-menu a:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #3498db;
  transition: width 0.3s ease;
}

.nav-menu a:hover {
  color: #3498db;
}

.nav-menu a:hover:after {
  width: 100%;
}

.post-list {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.post-item {
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.post-item-content {
  position: relative;
  padding: 16px 16px 16px 332px;
  flex: 1;
  display: flex;
  flex-direction: column;
  order: 1;
  text-decoration: none;
}

.post-item-image {
  border-radius: 8px;
  position: absolute;
  left: 16px;
  top: 16px;
  bottom: 16px;
  width: 300px;
  overflow: hidden;
  background-color: #f5f5f5;
}

.post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.post-item-image img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.post-title {
  margin-bottom: 8px;
  color: #3C4043;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 700;
  line-height: 28px;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}

.post-title:hover {
  color: #4087F7;
}

.post-meta {
  color: #7f8c8d;
  font-size: 0.95em;
  margin-bottom: 8px;
}

.post-excerpt {
  margin-bottom: 8px;
  overflow: hidden;
  color: #5E5E5E;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  align-self: stretch;
}

.read-more {
  color: #4087F7;
  font-family: "Helvetica Neue";
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.read-more:hover {
  text-decoration: underline;
}

.post {
  background-color: #fff;
}

.post-content {
  color: #2c3e50;
  line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin: 0 0 16px;
  color: #2c3e50;
  font-weight: 600;
}

.post-content p {
  margin-bottom: 16px;
}

.post-content ul,
.post-content ol {
  margin: 1em 0;
  padding-left: 16px;
}

.post-content img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0;
}

.article-detail {
  margin: 0 auto;
  border-radius: 8px;
  background: #FFF;
  box-shadow: 0px 3px 14px 2px rgba(0, 0, 0, 0.05);
}

main.article-detail {
  padding: 24px;
}

main.functional-page {
  max-width: 994px;
  margin: 0 auto;
  padding: 24px;
  border-radius: 8px;
  background-color: #fff;
}

.functional-page ul {
  margin-bottom: 1.5em;
  padding-left: 16px;
}

.functional-page h1 {
  font-size: 2.2em;
  margin-bottom: 1.5em;
  color: #2c3e50;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5em;
}

.functional-page p {
  margin-bottom: 1.5em;
  line-height: 1.8;
  color: #34495e;
  font-size: 1.1em;
}

.functional-page strong {
  color: #2c3e50;
  font-weight: 600;
}

@media (max-width: 995px) {
  .article-detail {
    margin: 0 12px;
  }

  main.article-detail {
    padding: 16px;
  }

  .post-content h1,
  .post-content h2,
  .post-content h3 {
    margin: 0 0 12px;
  }

  .post-content p {
    margin-bottom: 12px;
  }

  main.functional-page {
    padding: 16px;
    margin: 0 12px;
  }

  .functional-page h1 {
    font-size: 1.8em;
    margin-bottom: 1em;
  }

  .functional-page p {
    font-size: 1em;
  }
}

footer {
  text-align: center;
  padding: 12px 0;
  color: #8B8B8B;
  font-size: 12px;
}

.article-detail h1 {
  font-size: 24px;
  line-height: 36px;
}

.article-detail h2 {
  font-size: 1.6em;
}

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

  .nav-menu ul {
    flex-wrap: wrap;
    gap: 15px;
  }

  .post-list {
    grid-template-columns: 1fr;
  }
}

hr {
  margin-bottom: 12px;
  background: #5E5E5E;
}

@media (max-width: 640px) {
  .post-item-content {
    padding: 12px;
  }

  .post-item-image {
    position: static;
    align-self: stretch;
    aspect-ratio: 312.00/152.41;
    width: 100%;
  }

  .read-more {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    padding: 32px 12px 12px 12px;
    gap: 10px;
    align-self: stretch;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, #FFF 40%);
  }
}