/* news.html 独立基础样式（不复用，仅本页） */
body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  background-color: #f3f4f6;
  color: #333;
  margin: 0;
  padding: 0;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ================== 主页主内容区样式优化 ================== */
:root {
  --main-color: #1976d2;
  --main-radius: 12px;
  --main-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
  --main-bg: #fff;
  --card-bg: #f5faff;
  --card-radius: 8px;
  --card-shadow: 0 1px 4px rgba(25, 118, 210, 0.10);
}


.main-content {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 14px 14px;
  background: #fff;
}


.main-content h2 {
  font-size: 1.25rem;
  color: var(--main-color);
  font-weight: bold;
  margin: 0 0 18px 0;
  letter-spacing: 1px;
  line-height: 1.3;
  border-left: 1px solid var(--main-color);
  padding: 10px 12px;
  background: linear-gradient(90deg, #e3f2fd 60%, #fff 100%);
  border-radius: 6px;
  box-sizing: border-box;
}

@media (max-width: 800px) {
  .main-content {
    padding: 16px 4px;
    margin: 4px;
  }
}

/* news.css 动态资讯页面专用样式，可根据需要扩展 */

.news-section h1 {
  color: #1976d2;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.news-item {
  background: #f5fafe;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(25, 118, 210, 0.05);
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
  min-height: 38px;
  font-size: 1rem;
  transition: box-shadow 0.2s;
  border-bottom: 2px solid var(--main-color);
  margin: 0;
  flex-direction: column;
  justify-content: flex-start;
}

.news-item:hover {
  cursor: pointer;
  border-bottom: 6px solid var(--main-color);
}

.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.news-item:hover .news-title {
  color: #1976d2;
  font-weight: bold;
  font-style: italic;
}

.news-item:hover p {
  font-style: italic;
}

.news-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: calc(100% - 90px);
  display: block;
  font-size: 1.2rem;
  color: #242424;
  margin: 0;
  border: 0;
  background: 0;
  padding: 10px 0px;
  font-weight: bold;
}

.news-date {
  color: #888;
  font-size: 0.9rem;
  font-weight: normal;
}

.news-item:hover {
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.10);
}

.news-item p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 2.8em;
  margin: 0 0 0 0;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.4;
}


.news-categories {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.news-cat-btn {
  background: #e3f2fd;
  color: #1976d2;
  border: none;
  border-radius: 20px;
  padding: 7px 22px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  outline: none;
}

.news-cat-btn.active,
.news-cat-btn:hover {
  background: #1976d2;
  color: #fff;
}

.news-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 0 0;
}

.news-page-btn {
  background: #e3f2fd;
  color: #1976d2;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.news-page-btn.active,
.news-page-btn:hover {
  background: #1976d2;
  color: #fff;
}

.news-empty {
  color: #aaa;
  font-size: 1.08rem;
  text-align: center;
  padding: 24px 0;
}

.news-modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-modal-mask {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.32);
}

.news-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(25, 118, 210, 0.18);
  padding: 32px 28px 18px 28px;
  min-width: 320px;
  max-width: 96vw;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1;
  animation: modalIn 0.18s;
}

@keyframes modalIn {
  from {
    transform: translateY(40px) scale(0.98);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.news-modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #1976d2;
  cursor: pointer;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  transition: background 0.18s;
}

.news-modal-close:hover {
  background: #e3f2fd;
}

.news-modal-title {
  font-size: 1.4rem;
  font-weight: bold;
  text-align: left;
  margin-top: 12px;
  color: var(--main-color);
}

.news-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.news-modal-date {
  color: #888;
  font-size: 0.9rem;
  text-align: left;
  margin: 12px 0;
}

.news-tag {
  display: inline-block;
  background: #1976d2;
  color: #fff;
  font-size: 0.85rem;
  border-radius: 12px;
  padding: 2px 10px;
  margin-right: 8px;
  font-weight: 500;
  vertical-align: middle;
  letter-spacing: 1px;
  line-height: 1.2;
}

@media (max-width: 600px) {
  .news-modal-content {
    padding: 18px 6vw 12px 6vw;
    min-width: 0;
    max-width: 98vw;
  }
}

/* =============== 新增：API加载状态样式 =============== */
.news-loading, .news-empty, .news-error {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
  background: var(--main-bg);
  border-radius: var(--main-radius);
  box-shadow: var(--main-shadow);
  margin: 20px 0;
}

.news-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  color: #999;
}

.news-error {
  color: #e74c3c;
  background: #fdf2f2;
  border: 1px solid #fbb6b6;
}

.news-empty {
  color: #7f8c8d;
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 文章内容格式化样式 */
.news-modal-body p {
  margin: 12px 0;
  line-height: 1.8;
  text-align: justify;
}

.news-modal-body p:first-child {
  margin-top: 0;
}

.news-modal-body p:last-child {
  margin-bottom: 0;
}