/* 部落格樣式 */

.blog-search {
  padding: 20px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.blog-search input {
  width: calc(100% - 40px);
  max-width: 500px;
  padding: 12px 20px;
  font-size: 16px;
  border: 2px solid #d1d9f0;
  border-radius: 25px;
  outline: none;
  transition: border-color 0.3s;
  box-sizing: border-box;
  display: block;
  margin: 0 auto;
}

.blog-search input:focus {
  border-color: #5a8fde;
}

.blog-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px 25px;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  max-width: 600px;
  margin: 0 auto;
}

.category-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 1.5px solid #e1e4e8;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  color: #586069;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-btn:hover {
  background: linear-gradient(135deg, #e8eef5 0%, #f0f4f9 100%);
  border-color: #5a8fde;
  color: #5a8fde;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(90, 143, 222, 0.2);
}

.category-btn.active {
  background: linear-gradient(135deg, #5a8fde 0%, #4a7bc8 100%);
  border-color: #4a7bc8;
  color: white;
  box-shadow: 0 3px 10px rgba(90, 143, 222, 0.4);
  transform: translateY(-1px);
}

.category-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(90, 143, 222, 0.5);
}

.blog-list {
  padding: 0 20px 20px;
  width: 100%;
  box-sizing: border-box;
}

.blog-card {
  background: #f9fbfe;
  border: 1px solid #d1d9f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.3s;
}

.blog-card:hover {
  box-shadow: 0 4px 12px rgba(90, 143, 222, 0.2);
  transform: translateY(-2px);
}

.blog-card-date {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}

.blog-card-title {
  font-size: 18px;
  font-weight: bold;
  color: #2a3f78;
  margin-bottom: 10px;
}

.blog-card-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 10px;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-tag {
  display: inline-block;
  padding: 4px 10px;
  background-color: #e3ebf5;
  color: #5a8fde;
  font-size: 12px;
  border-radius: 12px;
}

/* 文章頁面樣式 */
.article-header {
  padding: 20px;
  text-align: center;
}

.article-title {
  font-size: 24px;
  font-weight: bold;
  color: #2a3f78;
  margin-bottom: 10px;
  line-height: 1.4;
}

.article-meta {
  font-size: 13px;
  color: #999;
  margin-bottom: 15px;
}

.article-content {
  padding: 20px;
  line-height: 1.8;
  color: #333;
}

.article-content h2 {
  font-size: 20px;
  color: #2a3f78;
  margin: 30px 0 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e3ebf5;
}

.article-content h3 {
  font-size: 18px;
  color: #2a3f78;
  margin: 25px 0 12px;
}

.article-content p {
  margin-bottom: 15px;
}

.article-content ul, .article-content ol {
  margin: 15px 0;
  padding-left: 25px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content a {
  color: #2a9d8f;
  text-decoration: none;
  border-bottom: 1px solid #2a9d8f;
}

.article-content a:hover {
  color: #21867a;
}

.article-content code {
  background-color: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.article-content pre {
  background-color: #f5f5f5;
  padding: 15px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 15px 0;
}

.article-content blockquote {
  border-left: 4px solid #5a8fde;
  padding-left: 15px;
  margin: 15px 0;
  color: #666;
  font-style: italic;
}

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

/* 廣告區塊 */
.ad-block {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  padding: 20px;
  margin: 25px 0;
  color: white;
  text-align: center;
}

.ad-block h3 {
  color: white !important;
  margin: 0 0 10px !important;
  border: none !important;
}

.ad-block p {
  margin-bottom: 15px;
  opacity: 0.95;
}

.ad-block .btn {
  background-color: white;
  color: #667eea;
  display: inline-block;
  padding: 10px 25px;
  text-decoration: none;
  border-radius: 25px;
  font-weight: bold;
  transition: all 0.3s;
}

.ad-block .btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255,255,255,0.3);
}

/* 特色內容區塊 - 繞過 Safari 內容阻擋器 */
.featured-content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-radius: 8px;
  padding: 20px;
  margin: 25px 0;
  color: white;
  text-align: center;
}

.featured-content h3 {
  color: white !important;
  margin: 0 0 10px !important;
  border: none !important;
  display: block !important;
  font-size: 1.3em;
  font-weight: bold;
}

.featured-content p {
  margin-bottom: 15px;
  opacity: 0.95;
  display: block !important;
  line-height: 1.5;
  font-size: 1em;
}

.featured-content a {
  background-color: white !important;
  color: #667eea !important;
  display: inline-block !important;
  padding: 10px 25px !important;
  text-decoration: none !important;
  border-radius: 25px !important;
  font-weight: bold !important;
  transition: all 0.3s;
  cursor: pointer;
  border: none !important;
  font-size: 1em;
}

.featured-content a:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255,255,255,0.3);
}

.featured-content a:active {
  transform: scale(0.98);
}

/* 內容盒子 - 避免被廣告攔截器偵測 */
.content-box {
  border-radius: 8px;
  padding: 20px;
  margin: 25px 0;
  color: white;
  text-align: center;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100%;
  box-sizing: border-box;
}

.content-box.featured-offer {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.content-box h3 {
  color: white !important;
  margin: 0 0 10px !important;
  border: none !important;
  display: block !important;
  font-size: 1.3em;
  font-weight: bold;
}

.content-box p {
  margin-bottom: 15px;
  opacity: 0.95;
  display: block !important;
  line-height: 1.5;
  font-size: 1em;
}

.content-box .btn {
  background-color: white !important;
  color: #667eea !important;
  display: inline-block !important;
  padding: 10px 25px !important;
  text-decoration: none !important;
  border-radius: 25px !important;
  font-weight: bold !important;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  font-size: 1em;
}

.content-box .btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255,255,255,0.3);
}

.content-box .btn:active {
  transform: scale(0.98);
}

/* Google AdSense 容器 */
.adsense-container {
  margin: 25px 0;
  text-align: center;
  min-height: 100px;
}

.back-to-blog {
  display: inline-block;
  margin: 20px;
  padding: 10px 20px;
  background-color: #5a8fde;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.3s;
}

.back-to-blog:hover {
  background-color: #4a7fce;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

/* 社交分享按鈕（簡潔設計）*/
.social-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  justify-content: center;
}

.share-label {
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  white-space: nowrap;
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e5e7eb;
}

.share-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: auto;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  border-color: currentColor;
}

.share-btn:hover { color: #1877f2; }
.share-btn:nth-child(2):hover { color: #000000; }
.share-btn:nth-child(3):hover { color: #00b900; }
.share-btn:nth-child(4):hover { color: #E4405F; }
.share-btn:nth-child(5):hover { color: #000000; }
.share-btn:nth-child(6):hover { color: #0088cc; }

/* 相關文章 */
.related-articles {
  margin: 50px 0;
  padding: 30px 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.related-articles-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 25px;
  text-align: center;
  color: #2d3748;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.related-article-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
}

.related-article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  border-color: #5a8fde;
}

.related-article-category {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.related-article-title {
  font-size: 18px;
  font-weight: bold;
  margin: 10px 0;
  color: #2d3748;
  line-height: 1.4;
}

.related-article-excerpt {
  font-size: 14px;
  color: #718096;
  line-height: 1.6;
  margin: 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  font-size: 13px;
  color: #a0aec0;
}

.related-article-link {
  color: #5a8fde;
  font-weight: 600;
}

/* CTA 行動呼籲（簡潔設計）*/
.article-cta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 35px 0;
}

.cta-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.cta-card:hover {
  border-color: #5a8fde;
  box-shadow: 0 4px 12px rgba(90, 143, 222, 0.1);
}

.cta-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cta-header svg {
  color: #5a8fde;
  flex-shrink: 0;
}

.cta-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
}

.cta-card p {
  font-size: 14px;
  color: #6b7280;
  margin: 8px 0 12px;
  line-height: 1.5;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #5a8fde;
  text-decoration: none;
  transition: all 0.2s;
}

.cta-link:hover {
  color: #4a7bc8;
  gap: 8px;
}

.popular-articles-list {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popular-article-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  text-decoration: none;
  color: #4a5568;
  transition: all 0.2s;
  font-size: 13px;
  line-height: 1.4;
}

.popular-article-item:hover {
  background: #e5e7eb;
  color: #2d3748;
  transform: translateX(2px);
}

.article-bullet {
  color: #5a8fde;
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 1px;
}

.article-title-text {
  flex: 1;
}

.no-articles {
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
  font-style: italic;
}

/* 閱讀資訊 */
.reading-info {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 15px 0;
  font-size: 14px;
  color: #718096;
}

.reading-info-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.reading-info-item svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .related-articles-grid {
    grid-template-columns: 1fr;
  }
  
  .article-cta {
    grid-template-columns: 1fr;
  }
  
  .share-buttons {
    gap: 8px;
  }
  
  .share-btn {
    width: 40px;
    height: 40px;
  }
}
