html {
  scroll-behavior: smooth;
}

.app-container {
  padding-top: 70px;
}

/* 文章列表頁面樣式 */
.articles-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.articles-header {
  text-align: center;
  margin-bottom: 40px;
}

.articles-title {
  font-size: 2rem;
  color: #333;
  margin-bottom: 10px;
  font-weight: bold;
}

.articles-subtitle {
  font-size: 1.1rem;
  color: #666;
  margin: 0;
}

/* 搜尋功能樣式 */
.search-container {
  max-width: 500px;
  margin: 0 auto;
}

.search-form {
  display: flex;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-input {
  flex: 1;
  padding: 12px 20px;
  border: none;
  outline: none;
  font-size: 1rem;
  background: transparent;
}

.search-input::placeholder {
  color: #999;
}

.search-button {
  padding: 12px 20px;
  background: #007bff;
  border: none;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-button:hover {
  background: #0056b3;
}

.search-button svg {
  width: 18px;
  height: 18px;
}

.articles-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.article-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: calc(min(50dvw, 600px) - 40px);
}

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

.article-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.article-card-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 0.9rem;
  border-bottom: 1px solid #dee2e6;
}

.article-card-image-placeholder::before {
  content: "";
}

.article-card-image.error {
  display: none;
}

.article-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
  line-height: 1.4;
  //
  overflow: hidden !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden !important;
}

.article-card-excerpt {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden !important;
}

.article-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #999;
  margin-top: auto;
}

.article-card-date {
  color: #666;
}

.article-card-info {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-card-info:hover {
  text-decoration: none;
}

.articles-pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}

.pagination-button {
  padding: 10px 15px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
}

.pagination-button:hover {
  background: #e9e9e9;
}

.pagination-button.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* 文章內容頁面樣式 */
.article-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.article-breadcrumb {
  margin-bottom: 30px;
  font-size: 0.9rem;
  color: #666;
}

.article-breadcrumb a {
  color: #007bff;
  text-decoration: none;
}

.article-breadcrumb a:hover {
  text-decoration: underline;
}

.article-content {
  background: white;
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.article-title {
  font-size: 2.2rem;
  color: #333;
  margin-bottom: 15px;
  font-weight: bold;
  line-height: 1.3;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #666;
  font-size: 0.95rem;
}

.article-date {
  color: #999;
}

.article-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 文章卡片中的標籤樣式 */
.article-card .article-tags {
  margin-top: -12px;
  margin-bottom: 0;
  padding: 0 20px 15px 20px;
}

.article-card .hashtag {
  font-size: 0.75rem;
  padding: 2px 6px 1px 6px;
}

.hashtag {
  display: inline-block;
  background-color: #b1cdff;
  color: #374a61;
  padding: 3px 8px 1px 8px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.hashtag:hover {
  transform: translateY(-1px);
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
}

.article-body h2 {
  font-size: 1.5rem;
  margin: 30px 0 20px 0;
  color: #333;
  font-weight: bold;
}

.article-body h3 {
  font-size: 1.3rem;
  margin: 25px 0 15px 0;
  color: #333;
  font-weight: bold;
}

.article-body p {
  margin-bottom: 20px;
}

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

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

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 20px 0;
}

/* YouTube 影片樣式 */
.article-body .ql-youtube {
  margin: 20px 0;
  position: relative;
}

.article-body .ql-youtube .youtube-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-body .ql-youtube .youtube-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 比例 */
}

.article-body .ql-youtube .youtube-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* 前端不需要移除按鈕，所以隱藏 */
.article-body .ql-youtube .youtube-overlay {
  display: none;
}

.article-footer {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #f0f0f0;
}

.article-share h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #333;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.3s ease;
}

.share-button:hover {
  background: #0056b3;
}

.share-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 手機版樣式 */
@media (max-width: 768px) {
  .articles-container,
  .article-container {
    padding: 20px 15px;
  }
  .article-card {
    max-width: 100%;
  }

  .article-card-image-placeholder {
    display: none;
  }
  .articles-title {
    font-size: 2rem;
  }

  .articles-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .article-content {
    padding: 20px;
  }

  .article-title {
    font-size: 1.8rem;
  }

  .article-body {
    font-size: 1rem;
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .top__layer {
    top: 60%; 
  }
}
