/* ============================================================
   网新云官网 · 新闻资讯模块 CSS
   ============================================================ */

/* ─── 新闻模块整体 ─── */
.news-section {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-light);
}

/* ─── 筛选标签 ─── */
.news-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 32px;
}
.filter-btn {
  padding: 7px 20px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
}
.filter-btn:hover {
  color: var(--accent);
  border-color: var(--accent-mid);
  background: var(--accent-dim);
}
.filter-btn.active {
  color: #fff;
  background: var(--gradient-1);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(0, 102, 255, 0.3);
}

/* ─── 搜索框 ─── */
.news-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.news-search input {
  width: 100%;
  padding: 11px 16px 11px 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.news-search input::placeholder { color: var(--text-muted); }
.news-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.news-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.news-count span { color: var(--accent); font-weight: 700; }

/* ─── 置顶文章 ─── */
.news-featured {
  margin-bottom: 32px;
}
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.featured-card:hover {
  border-color: var(--accent-mid);
  box-shadow: 0 16px 48px rgba(0, 200, 255, 0.1);
  transform: translateY(-4px);
}
.featured-image {
  position: relative;
  min-height: 300px;
  overflow: hidden;
}
.featured-image-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}
.featured-card:hover .featured-image-bg { transform: scale(1.05); }
.featured-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-1);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.featured-info {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.featured-category {
  font-size: 0.78rem;
  font-family: var(--font-display);
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.featured-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.4;
}
.featured-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.featured-meta span { display: flex; align-items: center; gap: 4px; }
.featured-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 8px;
  transition: gap 0.3s;
}
.featured-card:hover .featured-action { gap: 10px; }

/* ─── 文章网格 ─── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  border-color: var(--accent-mid);
  transform: translateY(-5px);
  box-shadow: 0 12px 36px rgba(0, 200, 255, 0.08);
}
.news-card-image {
  position: relative;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}
.news-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}
.news-card:hover .news-card-bg { transform: scale(1.06); }
.news-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 9, 20, 0.5) 0%, transparent 60%);
}
.news-card-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 102, 255, 0.8);
  backdrop-filter: blur(4px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.news-card-tags {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.news-tag {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.8);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
}
.news-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.news-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s;
}
.news-card:hover .news-card-title { color: var(--accent); }
.news-card-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}
.news-card-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.news-card-read {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── 加载更多 ─── */
.news-more {
  text-align: center;
  margin-top: 48px;
}
.news-more .btn { min-width: 180px; }

/* ─── 空状态 ─── */
.news-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.news-empty-icon { font-size: 4rem; margin-bottom: 16px; }
.news-empty p { font-size: 1rem; }

/* ─── 加载骨架屏 ─── */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.skeleton-image {
  height: 180px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-line.short { width: 60%; }
.skeleton-line.long { width: 90%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── 文章详情弹窗 ─── */
.article-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 9, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.article-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.article-modal {
  position: relative;
  width: 100%;
  max-width: 820px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: auto;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.35s ease;
}
.article-overlay.open .article-modal { transform: translateY(0); }
.article-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  transition: var(--transition);
  z-index: 10;
}
.article-close:hover { background: var(--accent); border-color: var(--accent); }
.article-header {
  position: relative;
  min-height: 300px;
  overflow: hidden;
}
.article-header-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.article-header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 24, 40, 0.95) 0%, rgba(8, 24, 40, 0.3) 60%, transparent 100%);
}
.article-header-content {
  position: relative;
  z-index: 2;
  padding: 40px;
  max-width: 720px;
}
.article-category-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.article-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 16px;
}
.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}
.article-meta-bar span { display: flex; align-items: center; gap: 5px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.article-tag {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.75);
  background: rgba(0, 200, 255, 0.15);
  border: 1px solid rgba(0, 200, 255, 0.2);
}
.article-body {
  padding: 40px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 2;
}
.article-body p { margin-bottom: 20px; }
.article-body h2, .article-body h3 {
  color: var(--text-primary);
  font-family: var(--font-display);
  margin: 28px 0 14px;
}
.article-body h2 { font-size: 1.4rem; }
.article-body h3 { font-size: 1.1rem; }
.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 20px;
}
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 8px 8px 0;
  color: var(--text-primary);
  font-style: italic;
}
.article-body code {
  padding: 2px 8px;
  background: rgba(0, 200, 255, 0.08);
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent);
}
.article-body pre {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}
.article-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 16px auto;
}
.article-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 40px 0;
}
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 24px 40px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-primary);
}
.article-nav-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.article-nav-item:hover { border-color: var(--border); background: var(--bg-card); }
.article-nav-item.next { text-align: right; }
.article-nav-label { font-size: 0.75rem; color: var(--text-muted); }
.article-nav-title { font-size: 0.88rem; color: var(--text-secondary); font-weight: 500; }

/* ─── 后台管理面板 ─── */
.admin-panel {
  display: none;
  min-height: 100vh;
  background: var(--bg-primary);
}
.admin-panel.active { display: block; }
.admin-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
}
.admin-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-title-bar h2 { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-primary); }
.admin-title-bar p { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 40px 20px;
}
.admin-login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.admin-login-box h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 8px; }
.admin-login-box > p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 28px; }
.admin-login-box .form-group { text-align: left; margin-bottom: 20px; }
.admin-login-box input { width: 100%; padding: 12px 16px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 0.9rem; outline: none; }
.admin-login-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.admin-tip { font-size: 0.78rem; color: var(--text-muted); margin-top: 12px; }

.admin-main { padding: 40px 0; }
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}
.admin-section h3 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 24px; color: var(--text-primary); border-bottom: 1px solid var(--border-light); padding-bottom: 12px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.admin-form-grid .form-group.full-col { grid-column: 1 / -1; }
.admin-form-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.admin-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; border-bottom: 1px solid var(--border-light); padding-bottom: 16px; }
.admin-list-header h3 { border-bottom: none; padding-bottom: 0; margin-bottom: 0; flex: 1; }
.admin-list-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-list-filters select { padding: 8px 14px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 0.85rem; outline: none; cursor: pointer; }
.admin-article-list { display: flex; flex-direction: column; gap: 12px; }
.admin-article-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: var(--transition);
}
.admin-article-item:hover { border-color: var(--border); background: var(--bg-card-hover); }
.admin-article-thumb {
  width: 80px;
  height: 56px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.admin-article-info { min-width: 0; }
.admin-article-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-article-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.admin-article-actions { display: flex; gap: 8px; flex-shrink: 0; }
.admin-article-actions button {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.admin-article-actions .btn-edit:hover { color: var(--accent); border-color: var(--accent-mid); }
.admin-article-actions .btn-del:hover { color: #ff5050; border-color: rgba(255,80,80,0.3); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.admin-stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.admin-stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 900; color: var(--accent); }
.admin-stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* ─── 响应式 ─── */
@media (max-width: 768px) {
  .featured-card { grid-template-columns: 1fr; }
  .featured-image { min-height: 220px; }
  .featured-info { padding: 24px; }
  .news-grid { grid-template-columns: 1fr; }
  .article-modal { border-radius: 16px 16px 0 0; margin-top: auto; }
  .article-overlay { padding: 0; align-items: flex-end; }
  .article-header { min-height: 200px; }
  .article-header-content { padding: 24px; }
  .article-body { padding: 24px; }
  .article-nav { grid-template-columns: 1fr; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-article-item { grid-template-columns: 60px 1fr; }
  .admin-article-actions { grid-column: 1 / -1; }
}
