/* ===== 新闻资讯页面 ===== */

.news-top {
  padding: 20px 0 24px;
  background: var(--bg);
}

.news-page {
  padding-top: 0;
  padding-bottom: 48px;
}

/* 标签 */
.news-tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 11px;
  line-height: 18px;
  border-radius: 999px;
  white-space: nowrap;
}

.news-tag--cat {
  color: var(--primary);
  background: #f0f7ff;
  border: 1px solid #d6ebff;
}

.news-tag--ind {
  color: #888;
  background: #f5f6f8;
}

/* 筛选 */
.news-filter {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--bg-white);
  border: 1px solid #eef1f5;
  border-radius: 12px;
  margin-bottom: 22px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.news-filter .filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  width: 100%;
  padding: 14px 20px;
  border-bottom: 1px solid #f3f5f8;
}

.news-filter .filter-group:last-of-type {
  border-bottom: none;
}

.news-filter-label,
.news-filter .filter-label {
  flex-shrink: 0;
  min-width: 40px;
  font-size: 12px;
  font-weight: 600;
  color: #8c8c8c;
}

.filter-pill {
  padding: 5px 14px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: #f5f7fa;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-pill:hover {
  color: var(--primary);
  background: #eef6ff;
}

.filter-pill.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.25);
}

.news-search,
.news-filter .filter-search {
  position: relative;
  width: 100%;
  padding: 14px 20px;
  background: #fafbfc;
  border-top: 1px solid #f3f5f8;
}

.news-search input,
.news-filter .filter-search input {
  width: 100%;
  max-width: none;
  padding: 10px 14px 10px 38px;
  border: 1px solid #e8ecf0;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  background: #fff;
  transition: all 0.2s;
}

.news-search input:focus,
.news-filter .filter-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.news-search::before {
  content: '⌕';
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  font-size: 15px;
  pointer-events: none;
}

/* 主布局：主栏略窄、侧栏加宽，视觉更均衡 */
.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
  align-items: start;
}

.news-main {
  min-width: 0;
}

.news-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.news-feed-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-feed-header h2::before {
  content: '';
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--primary);
}

.news-feed-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* 新闻列表 */
.news-feed {
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border: 1px solid #eef1f5;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.news-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f3f5f8;
  cursor: pointer;
  transition: background 0.2s ease;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item:hover {
  background: #f8fbff;
}

.news-item-img {
  width: 200px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f2f5;
}

.news-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.news-item:hover .news-item-img img {
  transform: scale(1.03);
}

.news-item-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.news-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.news-item h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  transition: color 0.2s;
}

.news-item:hover h3 {
  color: var(--primary);
}

.news-item .excerpt {
  margin: 0;
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 2px;
  font-size: 12px;
  color: #b0b0b0;
}

.news-item-meta span {
  white-space: nowrap;
}

.news-item-meta span + span::before {
  content: '·';
  margin-right: 16px;
  color: #ddd;
}

/* 侧边栏 */
.news-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* 新闻资讯全局检索 */
.news-global-search {
  position: relative;
  padding: 18px 20px 16px;
  background: var(--bg-white);
  border: 1px solid #eef1f5;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.news-global-search-label {
  display: block;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.news-global-search-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--primary);
  vertical-align: -2px;
}

.news-global-search-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.news-global-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #b0b8c4;
  pointer-events: none;
  display: flex;
}

.news-global-search-inner input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 42px;
  border: 1px solid #e4e8ee;
  border-radius: 10px;
  background: #fafbfc;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

/* 隐藏 type=search 浏览器自带清除按钮，避免与自定义清空按钮重复 */
.news-global-search-inner input[type="search"]::-webkit-search-cancel-button,
.news-global-search-inner input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.news-global-search-inner input[type="search"]::-ms-clear {
  display: none;
}

.news-global-search-inner input::placeholder {
  color: #b8bec8;
}

.news-global-search-inner input:hover {
  border-color: #d6e4ff;
  background: #fff;
}

.news-global-search-inner input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.news-global-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #eef1f5;
  color: #8c95a3;
  cursor: pointer;
  transition: all 0.2s;
}

.news-global-search-clear:hover {
  background: #e2e8f0;
  color: var(--text);
}

.news-global-search-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 120;
  background: var(--bg-white);
  border: 1px solid #e8ecf2;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.news-search-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #eef1f5;
}

.news-search-dropdown-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.news-search-dropdown-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.news-search-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 380px;
  overflow-y: auto;
}

.news-search-dropdown-list li {
  margin: 0;
}

.news-search-dropdown-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.news-search-dropdown-item:hover {
  background: #f5f9ff;
}

.news-search-dropdown-thumb {
  width: 72px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f2f5;
  flex-shrink: 0;
}

.news-search-dropdown-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-search-dropdown-body {
  min-width: 0;
}

.news-search-dropdown-body h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-search-dropdown-body h4 mark {
  padding: 0 2px;
  border-radius: 2px;
  background: #fff3bf;
  color: #ad6800;
  font-weight: 700;
}

.news-search-dropdown-body p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #8c8c8c;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-search-dropdown-body p mark {
  padding: 0 1px;
  border-radius: 2px;
  background: #fffbe6;
  color: #ad6800;
}

.news-search-dropdown-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 11px;
  color: #b0b8c4;
}

.news-search-dropdown-tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: #f0f7ff;
  color: var(--primary);
  border: 1px solid #d6ebff;
  font-weight: 500;
}

.news-search-dropdown-meta span + span::before {
  content: '·';
  margin-right: 10px;
  color: #ddd;
}

.news-search-dropdown-foot {
  padding: 10px 16px 12px;
  border-top: 1px solid #f0f2f5;
  background: #fafbfc;
}

.news-search-dropdown-more {
  width: 100%;
  height: 36px;
  border: 1px solid #d6ebff;
  border-radius: 8px;
  background: #f0f7ff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.news-search-dropdown-more:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.news-search-dropdown-empty {
  padding: 28px 20px 24px;
  text-align: center;
}

.news-search-dropdown-empty-icon {
  display: block;
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.65;
}

.news-search-dropdown-empty p {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.news-search-dropdown-empty span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 社区用户卡片 */
.community-card {
  padding: 20px 20px 18px;
  background: var(--bg-white);
  border: 1px solid #eef1f5;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.community-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.community-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0f2f5;
  color: #b0b8c4;
}

.community-avatar--user {
  background: linear-gradient(135deg, #69c0ff, var(--primary));
  color: #fff;
}

.community-avatar-letter {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.community-greet {
  min-width: 0;
}

.community-greet strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.community-greet p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.community-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f3f5f8;
}

.community-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.community-stat .label {
  font-size: 11px;
  color: #b0b8c4;
  white-space: nowrap;
}

.community-stat .value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.community-cta {
  padding: 14px 12px 12px;
  background: linear-gradient(180deg, #f5f9ff 0%, #f0f6ff 100%);
  border-radius: 10px;
}

.community-cta p {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.65;
  color: #6b7280;
  text-align: center;
}

.community-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.community-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

button.community-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
}

.community-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #40a9ff 0%, var(--primary) 100%);
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.28);
}

.community-btn--primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.35);
}

.community-btn svg {
  flex-shrink: 0;
}

.news-sidebar .widget {
  border: 1px solid #eef1f5;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.news-sidebar .widget-title {
  padding: 14px 20px;
  font-size: 15px;
}

.news-sidebar .widget-body {
  padding: 12px 20px 16px;
}

.sidebar-hot-list {
  counter-reset: hot;
}

.sidebar-hot-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f5f8;
  cursor: pointer;
}

.sidebar-hot-item:last-child {
  border-bottom: none;
}

.sidebar-hot-item:hover h4 {
  color: var(--primary);
}

.sidebar-hot-item .num {
  counter-increment: hot;
  flex-shrink: 0;
  width: 22px;
  font-size: 14px;
  font-weight: 700;
  color: #d0d0d0;
  line-height: 1.5;
}

.sidebar-hot-item .num::before {
  content: counter(hot, decimal-leading-zero);
}

.sidebar-hot-item:nth-child(-n+3) .num {
  color: var(--primary);
}

.sidebar-hot-item h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.sidebar-hot-item .views {
  font-size: 11px;
  color: #bbb;
  margin-top: 3px;
}

.sidebar-subscribe {
  padding: 22px 20px;
  background: linear-gradient(135deg, #1890ff 0%, #36cfc9 100%);
  border-radius: 12px;
  color: #fff;
  text-align: center;
  box-shadow: 0 2px 12px rgba(24, 144, 255, 0.2);
}

.sidebar-subscribe h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.sidebar-subscribe p {
  margin: 0 0 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.sidebar-subscribe input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  margin-bottom: 10px;
  outline: none;
}

.sidebar-subscribe input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.sidebar-subscribe .btn {
  width: 100%;
  background: #fff;
  color: var(--primary);
  border: none;
}

.sidebar-subscribe .btn:hover {
  background: #f0f7ff;
}

.news-feed .empty-state {
  padding: 56px 20px;
}

.news-main .news-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--bg-white);
  border: 1px solid #eef1f5;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.news-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #e8e8e8;
  border-radius: 50%;
  background: #fafafa;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.news-page-btn:hover:not(:disabled) {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.news-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.news-page-nums {
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-page-num {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #fafafa;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.news-page-num:hover,
.news-page-num.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.news-page-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* 响应式 */
@media (max-width: 1024px) {
  .news-layout {
    grid-template-columns: 1fr;
  }

  .news-item {
    grid-template-columns: 200px 1fr;
  }

  .news-item-img {
    width: 200px;
    height: 120px;
  }
}

@media (max-width: 640px) {
  .news-top {
    padding: 14px 0 18px;
  }

  .community-stats {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 10px;
  }

  .community-actions {
    grid-template-columns: 1fr;
  }

  .news-filter .filter-group {
    padding: 12px 16px;
  }

  .news-search,
  .news-filter .filter-search {
    padding: 12px 16px;
  }

  .news-search::before {
    left: 28px;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .news-item-img {
    width: 100%;
    height: 168px;
  }

  .news-item-meta span + span::before {
    margin-right: 12px;
  }
}
