/* ================================
   Common Layout Styles for CMS Pages
   ================================ */

/* Page Content Layout */
.page-content {
  width: 100%;
  background: linear-gradient(to bottom, var(--secondary-color) 0%, #ffffff 100%);
  min-height: calc(100vh - 300px);
  padding: 0;
  margin-top: 0;
  position: relative;
}

.page-content > .container {
  padding: 20px;
}

.page-wrapper {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* ================================
   Sidebar Navigation - Bootstrap 4 Card (隔离)
   ================================ */
.sidebar {
  width: var(--sidebar-width, 240px);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(26, 86, 148, 0.08);
}

.sidebar-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: #fff;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
}

.sidebar-nav {
  padding: 0;
}

/* Bootstrap Card 结构 - 全部加上 .sidebar 前缀隔离 */
.sidebar .card {
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
}

.sidebar .card + .card {
  border-top: 1px dashed #e8e8e8;
}

.sidebar .card-header {
  background: transparent;
  border: none;
  padding: 0;
}

.sidebar .card-body {
  padding: 0;
  background: #fafafa;
}

.sidebar .card-body .card {
  border-bottom: 1px dashed #e0e0e0;
}

.sidebar .card-body .card-header {
  background: transparent;
}

.sidebar .card-body .card-body {
  background: #f5f5f5;
  padding: 0;
}

/* 折叠按钮样式 */
.sidebar .accordion-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #2c3e50;
  text-decoration: none;
  background: transparent;
  border: none;
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar .accordion-btn::after {
  content: '▾';
  font-size: 10px;
  color: #8c98a9;
  float: right;
  transition: transform 0.2s ease;
}

.sidebar .accordion-btn:not(.collapsed)::after {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.sidebar .accordion-btn:hover {
  background: rgba(26, 86, 148, 0.06);
  color: var(--primary-color);
}

.sidebar .accordion-btn:not(.collapsed) {
  background: linear-gradient(90deg, rgba(26, 86, 148, 0.1) 0%, rgba(26, 86, 148, 0.05) 100%);
  color: var(--primary-color);
  font-weight: 600;
}

.sidebar .accordion-btn.sub {
  padding-left: 36px;
  font-size: 13px;
  font-weight: 500;
  color: #5a6c7d;
}

.sidebar .accordion-btn.sub:hover {
  color: var(--primary-color);
}

.sidebar .accordion-btn.sub2 {
  padding-left: 52px;
  font-size: 12px;
  font-weight: 400;
  background: #fafbfc;
  color: #666;
}

.sidebar .accordion-btn.sub2:hover {
  color: var(--primary-color);
  background: #f0f4f8;
}

/* 导航链接列表 */
.sidebar .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar .nav-list li {
  border-bottom: 1px dashed #e8e8e8;
}

.sidebar .nav-list li:last-child {
  border-bottom: none;
}

.sidebar .nav-link {
  display: block;
  padding: 10px 20px 10px 68px;
  font-size: 13px;
  color: #555;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-header h2 {
  font-size: 1.4rem;
  margin: 0;
}

.sidebar .nav-link:hover {
  background: rgba(26, 86, 148, 0.05);
  color: var(--primary-color);
  padding-left: 72px;
}

.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(26, 86, 148, 0.12) 0%, rgba(26, 86, 148, 0.06) 100%);
  color: var(--primary-color);
  font-weight: 600;
}

.sidebar .nav-link.active::before {
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  left: 50px;
}

/* ================================
   Content Area
   ================================ */
.content-area {
  flex: 1;
  min-width: 0;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  border-radius: 4px;
  overflow: hidden;
}

/* Breadcrumb */
.breadcrumb {
  padding: 12px 20px;
  background: var(--bg-light);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 0!important;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb .separator {
  margin: 0 8px;
}

.breadcrumb .current {
  color: var(--primary-color);
}

.content-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.content-header h1 {
  font-size: 22px;
  color: var(--primary-color);
  font-weight: bold;
  margin: 0;
}

/* ================================
   Article List Page
   ================================ */
.article-list {
  padding: 0;
}

.list-item {
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.list-item:hover {
  background: var(--bg-light);
}

.list-item-link {
  display: flex;
  padding: 20px;
  gap: 20px;
  text-decoration: none;
}

.list-item-link:hover {
  text-decoration: none!important;
}
.dropdown a:hover {
  text-decoration: none!important;
}

.list-item-content {
  flex: 1;
  min-width: 0;
  padding: 10px;
}

/* 默认隐藏缩略图 */
.list-item-thumb {
  display: none;
}

/* 新闻类列表显示缩略图 */
.article-list.show-thumb .list-item-thumb {
  display: block;
}

/* 纯文字列表（无摘要） */
.article-list.text-only .list-item-summary {
  display: none;
}

.list-item-title {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 500;
  line-height: 1.4;
}

.list-item:hover .list-item-title {
  color: var(--primary-color);
}

.list-item-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-item-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-light);
}

.list-item-thumb {
  width: 120px;
  height: 80px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 4px;
}

.list-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  gap: 15px;
}

.pagination-info {
  display: flex;
  gap: 15px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.pagination a:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.pagination .active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

.pagination .ellipsis {
  border: none;
}

/* ================================
   Article Detail Page
   ================================ */
.article-header {
  padding: 25px 20px 20px;
  border-bottom: 1px solid var(--border-color);
}

.article-title {
  font-size: 24px;
  color: var(--text-primary);
  font-weight: bold;
  line-height: 1.4;
  margin: 0 0 15px 0;
  text-align: center;
}

.article-meta {
  display: flex;
  gap: 25px;
  font-size: 13px;
  color: var(--text-secondary);
  justify-content: center;
}

.article-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-body {
  display: flex;
  gap: 25px;
  padding: 20px;
}

.article-content {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 15px;
  text-indent: 2em;
}

.article-attachments {
  margin-top: 30px;
  padding: 15px;
  background: var(--bg-light);
  border-radius: 4px;
}

.article-attachments h4 {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.attachment-link {
  display: block;
  padding: 8px 0;
  color: var(--primary-color);
  font-size: 14px;
  text-decoration: none;
}

.attachment-link:hover {
  text-decoration: underline;
}

.article-sidebar {
  width: 280px;
  flex-shrink: 0;
}

.related-item {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}

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

.related-item a {
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.5;
}

.related-item a:hover {
  color: var(--primary-color);
}

.article-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.back-to-list {
  color: var(--primary-color);
  font-size: 14px;
  text-decoration: none;
}

.back-to-list:hover {
  text-decoration: underline;
}

/* ================================
   Introduction Page
   ================================ */
.intro-body {
  padding: 25px 30px;
}

.intro-section {
  margin-bottom: 35px;
}

.intro-section:last-child {
  margin-bottom: 0;
}

.intro-section h2 {
  font-size: 18px;
  color: var(--primary-color);
  font-weight: bold;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: 15px;
}

.intro-section p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  text-indent: 2em;
  margin-bottom: 10px;
}

.intro-list {
  padding-left: 20px;
  margin: 0;
}

.intro-list li {
  font-size: 15px;
  line-height: 2;
  color: var(--text-primary);
  list-style: disc;
}

.org-chart {
  margin-top: 20px;
}

.org-node {
  text-align: center;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--white);
  border-radius: 8px;
  margin-bottom: 20px;
}

.org-title {
  font-size: 14px;
  opacity: 0.9;
}

.org-members {
  font-size: 18px;
  font-weight: bold;
  margin-top: 5px;
}

.org-branches {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.org-branch {
  flex: 1;
  max-width: 250px;
  text-align: center;
  padding: 12px;
  background: var(--secondary-color);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.contact-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-card {
  flex: 1;
  min-width: 200px;
  display: flex;
  gap: 15px;
  padding: 20px;
  background: var(--bg-light);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.contact-icon {
  font-size: 24px;
}

.contact-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.contact-value {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 992px) {
  .page-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .article-body {
    flex-direction: column;
  }

  .article-sidebar {
    width: 100%;
  }
}
