/* ============================================
   pages.css - Inner/Detail Page Styles
   Chinese Association Website (ynada.test)
   ============================================ */

/* --- Page Banner --- */
.page-banner {
  position: relative;
  width: 100%;
  height: 300px;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
}

.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(27, 122, 61, 0.82), rgba(26, 26, 46, 0.72));
  z-index: 1;
}

.page-banner__inner {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 20px;
}

.page-banner__title {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.page-banner__desc {
  font-size: 1.05rem;
  opacity: 0.88;
  line-height: 1.7;
}

/* --- Breadcrumb --- */
.breadcrumb {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 14px 0;
  font-size: 0.9rem;
  color: #666;
}

.breadcrumb__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  margin: 0 10px;
  color: #bbb;
}

.breadcrumb__item a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb__item a:hover {
  color: #1B7A3D;
}

.breadcrumb__item--current {
  color: #333;
  font-weight: 600;
}

/* --- Page Layout --- */
.page-layout {
  display: flex;
  gap: 4%;
  padding: 40px 0;
}

.page-content {
  width: 70%;
  min-width: 0;
}

.page-sidebar {
  width: 28%;
  min-width: 0;
}

/* --- Category Filter --- */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.category-filter__item {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #555;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}

.category-filter__item:hover {
  border-color: #1B7A3D;
  color: #1B7A3D;
}

.category-filter__item--active,
.category-filter__item--active:hover {
  background: #1B7A3D;
  border-color: #1B7A3D;
  color: #fff;
}

/* --- Article Card --- */
.article-card {
  display: flex;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  margin-bottom: 24px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.article-card__image {
  width: 200px;
  min-height: 180px;
  flex-shrink: 0;
  overflow: hidden;
}

.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.article-card:hover .article-card__image img {
  transform: scale(1.06);
}

.article-card__body {
  flex: 1;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.article-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 10px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.article-card__title a:hover {
  color: #1B7A3D;
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: #999;
  margin-bottom: 10px;
}

.article-card__tag {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(27, 122, 61, 0.08);
  color: #1B7A3D;
  border-radius: 3px;
  font-size: 0.78rem;
}

.article-card__excerpt {
  font-size: 0.92rem;
  color: #666;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.article-card__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  color: #1B7A3D;
  text-decoration: none;
  font-weight: 500;
  transition: gap 0.2s;
}

.article-card__link::after {
  content: "→";
}

.article-card__link:hover {
  gap: 8px;
}

/* --- Article Detail --- */
.article-detail {
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  padding: 36px 40px;
}

.article-detail__header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

.article-detail__title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.4;
  margin-bottom: 16px;
}

.article-detail__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 0.88rem;
  color: #999;
  flex-wrap: wrap;
}

.article-detail__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Rich text content */
.article-detail__content {
  font-size: 1rem;
  color: #333;
  line-height: 1.9;
}

.article-detail__content p {
  margin-bottom: 1.2em;
}

.article-detail__content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 2em 0 0.8em;
  padding-left: 12px;
  border-left: 4px solid #1B7A3D;
}

.article-detail__content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 1.6em 0 0.6em;
}

.article-detail__content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #333;
  margin: 1.4em 0 0.5em;
}

.article-detail__content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1em 0;
}

.article-detail__content blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 4px solid #D4A843;
  background: #fffdf5;
  color: #555;
  border-radius: 0 4px 4px 0;
}

.article-detail__content ul,
.article-detail__content ol {
  margin: 1em 0;
  padding-left: 1.8em;
}

.article-detail__content li {
  margin-bottom: 0.5em;
}

.article-detail__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}

.article-detail__content th,
.article-detail__content td {
  border: 1px solid #e0e0e0;
  padding: 10px 14px;
  text-align: left;
}

.article-detail__content th {
  background: #f8f9fa;
  font-weight: 600;
  color: #1a1a2e;
}

.article-detail__content tr:hover td {
  background: #fafafa;
}

/* Article navigation */
.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
  gap: 20px;
}

.article-nav__item {
  flex: 1;
  min-width: 0;
}

.article-nav__item--next {
  text-align: right;
}

.article-nav__label {
  display: block;
  font-size: 0.82rem;
  color: #999;
  margin-bottom: 6px;
}

.article-nav__item a {
  font-size: 0.95rem;
  color: #333;
  text-decoration: none;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-nav__item a:hover {
  color: #1B7A3D;
}

/* Article share */
.article-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.article-share__label {
  font-size: 0.9rem;
  color: #999;
}

.article-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}

.article-share__btn:hover {
  background: #1B7A3D;
  border-color: #1B7A3D;
  color: #fff;
}

/* --- Single Page --- */
.single-page {
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  padding: 36px 40px;
}

.single-page__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #1B7A3D;
}

.single-page__content {
  font-size: 1rem;
  color: #333;
  line-height: 1.9;
}

.single-page__content p { margin-bottom: 1.2em; }
.single-page__content img { max-width: 100%; height: auto; border-radius: 4px; margin: 1em 0; }

/* --- Search --- */
.search-header {
  margin-bottom: 28px;
}

.search-header__text {
  font-size: 1rem;
  color: #666;
}

.search-header__text strong {
  color: #1B7A3D;
}

.search-form {
  display: flex;
  max-width: 560px;
  margin-bottom: 30px;
}

.search-form__input {
  flex: 1;
  height: 46px;
  padding: 0 18px;
  border: 2px solid #e0e0e0;
  border-right: none;
  border-radius: 4px 0 0 4px;
  font-size: 0.95rem;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
}

.search-form__input:focus {
  border-color: #1B7A3D;
}

.search-form__btn {
  height: 46px;
  padding: 0 28px;
  background: #1B7A3D;
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.25s;
  white-space: nowrap;
}

.search-form__btn:hover {
  background: #15632f;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  padding-top: 24px;
}

.pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  color: #555;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.25s;
  cursor: pointer;
}

.pagination__item:hover {
  border-color: #1B7A3D;
  color: #1B7A3D;
}

.pagination__item--active,
.pagination__item--active:hover {
  background: #1B7A3D;
  border-color: #1B7A3D;
  color: #fff;
  font-weight: 600;
}

.pagination__item--disabled {
  color: #ccc;
  pointer-events: none;
}

.pagination__item--prev,
.pagination__item--next {
  font-weight: 600;
}

/* --- Sidebar Widgets --- */
.sidebar-widget {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
}

.sidebar-widget__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 18px;
  padding-left: 12px;
  border-left: 4px solid #1B7A3D;
  line-height: 1.3;
}

.sidebar-widget__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-widget__list li {
  border-bottom: 1px dashed #eee;
}

.sidebar-widget__list li:last-child {
  border-bottom: none;
}

.sidebar-widget__list a {
  display: block;
  padding: 10px 0;
  color: #555;
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s, padding-left 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-widget__list a:hover {
  color: #1B7A3D;
  padding-left: 6px;
}

/* Navigation widget */
.sidebar-widget--nav .sidebar-widget__list a {
  padding: 11px 0;
  font-size: 0.95rem;
  position: relative;
}

.sidebar-widget--nav .sidebar-widget__list a::before {
  content: "›";
  margin-right: 8px;
  color: #1B7A3D;
  font-weight: 700;
}

.sidebar-widget--nav .sidebar-widget__list a.active {
  color: #1B7A3D;
  font-weight: 600;
}

/* Hot articles widget */
.sidebar-widget--hot .sidebar-widget__list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sidebar-widget--hot .sidebar-widget__list .hot-rank {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: #e0e0e0;
  color: #999;
  font-size: 0.75rem;
  font-weight: 700;
}

.sidebar-widget--hot .sidebar-widget__list li:nth-child(-n+3) .hot-rank {
  background: #C41E24;
  color: #fff;
}

/* Join / CTA widget */
.sidebar-widget--join {
  background: linear-gradient(135deg, #1B7A3D, #15632f);
  border-color: #1B7A3D;
  text-align: center;
  color: #fff;
}

.sidebar-widget--join .sidebar-widget__title {
  color: #fff;
  border-left-color: #D4A843;
}

.sidebar-widget--join p {
  font-size: 0.92rem;
  opacity: 0.9;
  margin-bottom: 18px;
  line-height: 1.6;
}

.sidebar-widget--join .btn-join {
  display: inline-block;
  padding: 10px 32px;
  background: #D4A843;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s;
}

.sidebar-widget--join .btn-join:hover {
  background: #c49a38;
}

/* Download widget */
.sidebar-widget--download .sidebar-widget__list a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-widget--download .sidebar-widget__list a::before {
  content: "⬇";
  font-size: 0.8rem;
  color: #1B7A3D;
}

/* --- Error Page --- */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-page__code {
  font-size: 7rem;
  font-weight: 800;
  color: #e0e0e0;
  line-height: 1;
  margin-bottom: 16px;
}

.error-page__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 12px;
}

.error-page__desc {
  font-size: 1rem;
  color: #999;
  margin-bottom: 32px;
}

.error-page__btn {
  display: inline-block;
  padding: 12px 36px;
  background: #1B7A3D;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.25s;
}

.error-page__btn:hover {
  background: #15632f;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .page-banner {
    height: 200px;
    background-attachment: scroll;
  }

  .page-banner__title {
    font-size: 1.6rem;
  }

  .page-layout {
    flex-direction: column;
    padding: 24px 0;
  }

  .page-content,
  .page-sidebar {
    width: 100%;
  }

  .article-card {
    flex-direction: column;
  }

  .article-card__image {
    width: 100%;
    min-height: 180px;
    max-height: 200px;
  }

  .article-detail,
  .single-page {
    padding: 24px 18px;
  }

  .article-detail__title {
    font-size: 1.4rem;
  }

  .article-nav {
    flex-direction: column;
    gap: 12px;
  }

  .article-nav__item--next {
    text-align: left;
  }

  .search-form {
    max-width: 100%;
  }

  .error-page__code {
    font-size: 4.5rem;
  }
}
