/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
  min-width: 320px;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: #1a73e8;
  transition: all 0.3s ease;
}

a:hover {
  color: #0d47a1;
  text-decoration: underline;
}

.container {
  width: 1200px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 15px;
}

/* 头部样式 */
.tech-header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  margin-right: 10px;
}

.logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1a73e8;
}

.search-box {
  flex: 1;
  max-width: 500px;
  margin: 0 30px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 30px;
  font-size: 14px;
  transition: all 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.search-box button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
}

.main-nav ul {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
}

.main-nav li {
  margin: 0 5px;
}

.main-nav a {
  display: block;
  padding: 8px 15px;
  font-weight: 500;
  color: #444;
  border-radius: 4px;
}

.main-nav a:hover, .main-nav .active a {
  background: #1a73e8;
  color: #fff;
  text-decoration: none;
}

.mobile-menu-btn {
  display: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
}

.mobile-menu-btn span {
  height: 3px;
  width: 100%;
  background-color: #444;
  border-radius: 10px;
  transition: all 0.3s;
}

/* 内容区域 */
.tech-main {
  display: flex;
  gap: 30px;
  padding: 40px 0;
  flex-wrap: wrap;
}

.tech-content {
  flex: 7;
  min-width: 300px;
}

.tech-sidebar {
  flex: 3;
  min-width: 300px;
}

/* 文章内容区域 */
.article-container {
  background: #fff;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  margin-bottom: 40px;
}

.article-header {
  margin-bottom: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
}

.article-title {
  font-size: 32px;
  line-height: 1.3;
  margin-bottom: 15px;
  color: #1a1a1a;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  color: #666;
  font-size: 14px;
}

.article-meta span {
  display: flex;
  align-items: center;
}

.article-meta i {
  margin-right: 5px;
}

.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: #333;
}

.article-content p {
  margin-bottom: 20px;
}

.article-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 25px auto;
  border-radius: 8px;
  box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.article-content h2, 
.article-content h3, 
.article-content h4 {
  margin: 30px 0 15px;
  color: #1a1a1a;
  position: relative;
  padding-left: 15px;
}

.article-content h2:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #1a73e8;
  border-radius: 2px;
}

.article-content blockquote {
  border-left: 4px solid #1a73e8;
  padding: 10px 20px;
  margin: 20px 0;
  background: #f1f8ff;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0;
}

.article-tags a {
  display: inline-block;
  padding: 5px 15px;
  background: #f1f8ff;
  color: #1a73e8;
  border-radius: 30px;
  font-size: 14px;
}

.article-tags a:hover {
  background: #1a73e8;
  color: #fff;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.article-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-nav a {
  display: flex;
  align-items: center;
}

.article-nav a.prev:before {
  content: "←";
  margin-right: 5px;
}

.article-nav a.next:after {
  content: "→";
  margin-left: 5px;
}

.article-actions {
  display: flex;
  gap: 10px;
}

.article-actions a {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  background: #f1f8ff;
  border-radius: 30px;
  color: #1a73e8;
}

.article-actions a:hover {
  background: #1a73e8;
  color: #fff;
}

/* 相关文章 */
.related-articles {
  background: #fff;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1a73e8;
  display: inline-block;
  color: #333;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-item {
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s;
  border: 1px solid #eee;
}

.related-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.related-img {
  display: block;
  height: 150px;
  overflow: hidden;
}

.related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.related-item:hover .related-img img {
  transform: scale(1.05);
}

.related-content {
  padding: 15px;
}

.related-content h3 {
  font-size: 16px;
  margin-bottom: 10px;
  height: 45px;
  overflow: hidden;
  line-height: 1.4;
}

/* 评论区域 */
.comment-section {
  background: #fff;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.comment-list {
  margin-top: 20px;
}

.comment-item {
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-weight: bold;
  color: #1a73e8;
}

.comment-author {
  font-weight: bold;
  margin-right: 15px;
}

.comment-date {
  color: #777;
  font-size: 13px;
}

.comment-content {
  line-height: 1.6;
}

.comment-form {
  margin-top: 30px;
}

.comment-form h3 {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
}

.form-group textarea {
  min-height: 150px;
}

.submit-btn {
  background: #1a73e8;
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.3s;
}

.submit-btn:hover {
  background: #0d47a1;
}

/* 侧边栏样式 */
.sidebar-widget {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.widget-title {
  font-size: 18px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1a73e8;
  display: inline-block;
  color: #333;
}

.about-content {
  text-align: center;
}

.about-content img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 3px solid #e8f0fe;
}

.about-content p {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.6;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f8ff;
  color: #1a73e8;
  font-size: 18px;
  transition: all 0.3s;
}

.social-links a:hover {
  background: #1a73e8;
  color: #fff;
  transform: translateY(-3px);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud a {
  display: inline-block;
  padding: 5px 12px;
  background: #f1f8ff;
  color: #1a73e8;
  border-radius: 30px;
  font-size: 13px;
}

.tag-cloud a:hover {
  background: #1a73e8;
  color: #fff;
}

.popular-list {
  list-style: none;
}

.popular-list li {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
}

.popular-list li:last-child {
  border-bottom: none;
}

.top-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #e8f0fe;
  color: #1a73e8;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  margin-right: 10px;
  flex-shrink: 0;
}

.popular-list li:nth-child(1) .top-num {
  background: #ff6d00;
  color: #fff;
}

.popular-list li:nth-child(2) .top-num {
  background: #1a73e8;
  color: #fff;
}

.popular-list li:nth-child(3) .top-num {
  background: #0d47a1;
  color: #fff;
}

.friend-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.friend-links a {
  display: inline-block;
  padding: 5px 15px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
}

.friend-links a:hover {
  background: #e8f0fe;
  color: #1a73e8;
}

/* 页脚区域 */
.tech-footer {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 60px 0 20px;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.footer-widget h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #fff;
  padding-bottom: 10px;
  border-bottom: 2px solid #1a73e8;
  display: inline-block;
}

.footer-widget p {
  font-size: 14px;
  margin-bottom: 15px;
  opacity: 0.8;
  line-height: 1.6;
}

.footer-category {
  list-style: none;
}

.footer-category li {
  margin-bottom: 10px;
}

.footer-category a {
  color: #ecf0f1;
  opacity: 0.8;
}

.footer-category a:hover {
  opacity: 1;
  color: #fff;
}

.contact-info {
  list-style: none;
}

.contact-info li {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
}

.contact-info i {
  margin-right: 10px;
  width: 24px;
  height: 24px;
  background: #1a73e8;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-social a {
  display: flex;
  align-items: center;
  color: #ecf0f1;
  opacity: 0.8;
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  transition: all 0.3s;
}

.footer-social a:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
}

.footer-social i {
  margin-right: 8px;
  font-size: 18px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
}

.copyright {
  margin-bottom: 15px;
  font-size: 14px;
  opacity: 0.7;
}

.copyright a {
  color: #ecf0f1;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
}

.footer-nav a {
  color: #ecf0f1;
  opacity: 0.8;
  white-space: nowrap;
}

.footer-nav a:hover {
  opacity: 1;
}

/* 返回顶部 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #1a73e8;
  color: #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.3s;
  z-index: 999;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-5px);
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-widgets {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .header-content {
    position: relative;
  }
  
  .search-box {
    order: 3;
    margin: 15px 0 0;
    max-width: 100%;
    flex: 0 0 100%;
  }
}

@media (max-width: 768px) {
  .logo h1 {
    font-size: 20px;
  }
  
  .main-nav {
    display: none;
    width: 100%;
    margin-top: 15px;
    order: 4;
  }
  
  .main-nav.show {
    display: block;
  }
  
  .main-nav ul {
    flex-direction: column;
  }
  
  .main-nav li {
    margin: 5px 0;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .tech-main {
    flex-direction: column;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-widgets {
    grid-template-columns: 1fr;
  }
  
  .article-title {
    font-size: 26px;
  }
}

/* 图标样式 */
.icon-search:before { content: "🔍"; }
.icon-author:before { content: "👤"; }
.icon-time:before { content: "🕒"; }
.icon-view:before { content: "👁️"; }
.icon-email:before { content: "✉️"; }
.icon-phone:before { content: "📱"; }
.icon-location:before { content: "📍"; }
.icon-wechat:before { content: "💬"; }
.icon-weibo:before { content: "🔊"; }
.icon-twitter:before { content: "🐦"; }
.icon-github:before { content: "🐙"; }
.icon-arrow-up:before { content: "↑"; }