:root {
  color-scheme: light;
}

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

body {
  margin: 0;
  font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background-color: #ffffff;
}

a {
  color: #333;
  text-decoration: none;
}

a:hover,
a:focus {
  color: #555;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -40px;
  padding: 8px 16px;
  background: #333;
  color: #fff;
  z-index: 1000;
}

.skip-link:focus {
  top: 16px;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 80%;
  margin: 0 auto;
  padding: 0 32px;
}

header.site-header {
  background: #fff;
  border-bottom: none;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  gap: 20px;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: #1a1a1a;
}

.search-container {
  flex: 1;
  max-width: 400px;
}

.search-form {
  position: relative;
  display: flex;
  width: 100%;
}

.search-input {
  flex: 1;
  padding: 12px 45px 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 14px;
  background: #f8f9fa;
  transition: all 0.3s ease;
  outline: none;
}

.search-input:focus {
  border-color: #9a9a9a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(90, 90, 90, 0.15);
}

.search-button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: #cccccc;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #444;
}

.search-button:hover {
  background: #b8b8b8;
  transform: translateY(-50%) scale(1.05);
}

.search-button span {
  font-size: 16px;
  line-height: 1;
}

nav.site-nav {
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  background: #f8f8f8;
  overflow: hidden;
}

@media (max-width: 1024px) {
  nav.site-nav {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  
  nav.site-nav::-webkit-scrollbar {
    display: none;
  }
}

.site-nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: block;
  padding: 15px 30px;
  color: #333;
  border-right: 1px solid #ddd;
  transition: background-color 0.3s;
  font-size: 16px;
}

.site-nav li:last-child a {
  border-right: none;
}

.site-nav a:hover,
.site-nav a:focus {
  background: #e8e8e8;
}

main {
  padding: 30px 0;
  flex: 1;
}

.intro-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  padding: 40px;
  background: #f9f9f9;
  margin-bottom: 30px;
  border: 1px solid #e6e6e6;
}

.intro-section h1 {
  font-size: 36px;
  font-weight: bold;
  color: #1a1a1a;
  margin-bottom: 20px;
}

.intro-section p {
  font-size: 18px;
  color: #555;
  line-height: 1.8;
}

.intro-highlight {
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 20px;
}

.intro-highlight h3 {
  margin-bottom: 12px;
  font-size: 18px;
  color: #444;
}

.intro-highlight ul {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 1.8;
}

.intro-highlight li::before {
  content: "•";
  color: #999;
  margin-right: 8px;
}

.content-wrapper {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  clear: both;
}

.main-content {
  flex: 3;
  min-width: 0;
  width: 0; /* 修复flex布局问题 */
  box-sizing: border-box;
}

.sidebar {
  flex: 1;
  min-width: 280px;
  box-sizing: border-box;
}

.article-list {
  background: #fff;
  border: 1px solid #ddd;
}

.article-item {
  padding: 24px;
  border-bottom: 1px solid #e8e8e8;
}

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

.article-featured {
  background: #f7f7f7;
  border-left: 4px solid #bdbdbd;
  padding-left: 20px;
}

.article-title {
  margin-bottom: 10px;
}

.article-title a {
  font-size: 20px;
  font-weight: bold;
  color: #1a1a1a;
  line-height: 1.4;
}

.article-title a:hover {
  color: #555555;
}

.article-meta {
  font-size: 14px;
  color: #777;
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.article-excerpt {
  font-size: 16px;
  color: #555;
  line-height: 1.7;
}

.tag-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  padding: 4px 10px;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #555;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tag:hover {
  color: #222;
  border-color: #b5b5b5;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0;
  gap: 10px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: 14px;
  color: #333;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  transition: all 0.3s;
  min-width: 44px;
  height: 44px;
}

.page-link:hover {
  background: #f0f0f0;
  border-color: #a7a7a7;
  color: #4a4a4a;
}

.page-link.active {
  background: #dcdcdc;
  border-color: #dcdcdc;
  color: #333;
  font-weight: bold;
}

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

.pagebar .page-link,
.pagebar .page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
}

.pagebar .now-page,
.pagebar .page-link.active {
  background: #dcdcdc;
  border-color: #dcdcdc;
}

.widget {
  background: #fff;
  border: 1px solid #ddd;
  margin-bottom: 20px;
  border-radius: 0;
}

.widget-title {
  background: #f5f5f5;
  padding: 12px 20px;
  border-bottom: 1px solid #ddd;
  font-size: 18px;
  font-weight: bold;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.4;
}

.widget-content {
  padding: 20px;
  text-align: left;
}

.widget-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget-content li {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.widget-content li:last-child {
  border-bottom: none;
}

.widget-content a {
  color: #333;
  font-size: 16px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-content a:hover {
  color: #555555;
}

.widget-content table {
  width: 100%;
  border-collapse: collapse;
}

.widget-content th,
.widget-content td {
  text-align: left;
  padding: 4px 0;
}

footer.site-footer {
  background: #2c2c2c;
  color: #ccc;
  text-align: center;
  padding: 25px 0;
  margin-top: 40px;
}

footer.site-footer p {
  margin: 8px 0;
  color: #ccc;
}

footer.site-footer p:last-child {
  font-size: 12px;
}

footer.site-footer a {
  color: #ccc;
  text-decoration: none;
}

footer.site-footer a:hover {
  color: #ccc;
  text-decoration: underline;
}

.single-wrapper {
  display: flex;
  gap: 30px;
}

.single-article {
  background: #fff;
  border: 1px solid #ddd;
  padding: 30px;
  margin-bottom: 20px;
}

.single-article h1 {
  font-size: 28px;
  margin: 0 0 16px;
}

.single-meta {
  font-size: 14px;
  color: #777;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.article-body {
  font-size: 18px;
  color: #333;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.comment-area {
  margin-top: 40px;
}

.comment {
  margin-bottom: 16px;
}

.comment-card {
  border: 1px solid #e6e6e6;
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.comment-meta .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #ddd;
  flex-shrink: 0;
}

.comment-meta strong {
  font-weight: bold;
  color: #333;
  font-size: 15px;
}

.comment-meta span {
  color: #777;
  font-size: 13px;
  flex: 1;
}

.comment-meta .comment-reply {
  margin-left: auto;
}

.comment-body {
  color: #444;
  line-height: 1.7;
  font-size: 15px;
  margin-left: 50px;
}

.comment-children {
  margin-left: 40px;
  margin-top: 16px;
  padding-left: 20px;
  border-left: 2px solid #e0e0e0;
}

.comment-form {
  border: 1px solid #e0e0e0;
  padding: 20px;
  background: #fafafa;
}

.comment-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid #ccc;
  padding: 10px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.comment-form button {
  background: #333;
  color: #fff;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
}

.comment-reply {
  border: 1px solid #d0d0d0;
  background: #f5f5f5;
  color: #444;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.comment-reply:hover {
  background: #e3e3e3;
}

.related-articles-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-article-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.related-article-item a {
  display: block;
  color: #333;
  text-decoration: none;
  transition: color 0.3s;
}

.related-article-item a:hover {
  color: #555;
}

.related-article-title {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.related-article-meta {
  display: block;
  font-size: 12px;
  color: #999;
}

.empty-state {
  padding: 40px;
  border: 1px dashed #ccc;
  text-align: center;
}

.page-header {
  padding: 30px 0;
  margin-bottom: 30px;
  border-bottom: 2px solid #e0e0e0;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
  clear: both;
}

.page-header h1 {
  font-size: 32px;
  margin: 0 0 10px;
  color: #1a1a1a;
  font-weight: bold;
  line-height: 1.3;
}

.page-header p {
  font-size: 16px;
  color: #666;
  margin: 0;
  line-height: 1.6;
}


@media (max-width: 1024px) {
  .container {
    width: 100%;
    padding: 0 15px;
  }
  
  .site-header .container {
    padding: 0;
  }

  .header-top {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    padding: 0 15px;
  }

  .search-container {
    max-width: none;
    width: 100%;
  }

  .site-nav {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav ul {
    width: max-content;
    min-width: 100%;
    flex-wrap: nowrap;
  }
  
  .site-nav li {
    flex-shrink: 0;
  }

  .content-wrapper {
    gap: 25px;
  }

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

@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 0 15px;
  }
  
  .site-header .container {
    padding: 0;
  }

  .header-top {
    text-align: center;
    padding: 0 15px;
  }

  .site-nav {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav ul {
    width: max-content;
    min-width: 100%;
    justify-content: flex-start;
    gap: 0;
    flex-wrap: nowrap;
  }
  
  .site-nav li {
    flex-shrink: 0;
  }

  .site-nav a {
    padding: 12px 18px;
    font-size: 14px;
    white-space: nowrap;
  }

  .intro-section {
    display: none;
  }

  .content-wrapper {
    flex-direction: column;
    width: 100%;
  }
  
  .main-content {
    width: 100%;
  }
  
  .sidebar {
    width: 100%;
    min-width: 0;
  }
  
  .page-header {
    width: 100%;
    padding: 20px 0;
  }
}

@media (max-width: 480px) {
  .container {
    width: 100%;
    padding: 0 8px;
  }
  
  .site-header .container {
    padding: 0;
  }

  .header-top {
    gap: 8px;
    padding: 12px 15px;
  }

  .logo {
    font-size: 20px;
  }

  .search-input {
    padding: 12px 14px;
    font-size: 16px;
  }

  .search-button {
    width: 44px;
    height: 44px;
  }

  .site-nav {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 0;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav ul {
    width: max-content;
    min-width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }
  
  .site-nav li {
    flex-shrink: 0;
  }

  .site-nav a {
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    background: #f8f9fa;
    color: #495057;
    white-space: nowrap;
  }

  .intro-section {
    display: none;
  }

  .intro-section h1 {
    font-size: 22px;
  }

  .content-wrapper {
    margin-top: 20px;
  }

  .article-list {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  }

  .article-item {
    padding: 20px;
  }

  .sidebar {
    width: 100%;
    margin-top: 20px;
  }

  .widget {
    border-radius: 0;
    margin-bottom: 16px;
  }

  .widget-title {
    margin: 0;
    font-size: 16px;
    padding: 10px 16px;
  }

  .widget-content li {
    padding: 12px 0;
    line-height: 1.6;
    display: block;
  }

  footer.site-footer {
    margin: 30px -8px 0;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .page-link {
    border-radius: 8px;
  }

  .page-link.prev,
  .page-link.next {
    min-width: 80px;
  }
}

@media (max-width: 768px) {
  .article-title a,
  .site-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .widget-content a {
    min-height: 44px;
    display: block;
  }

  .comment-body {
    margin-left: 0;
    margin-top: 10px;
  }

  .comment-children {
    margin-left: 20px;
    padding-left: 15px;
  }

  .page-header {
    padding: 20px 0;
  }

  .page-header h1 {
    font-size: 24px;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }
}

