﻿/* ==========================================================
   news.css - 新闻栏目专用样式
   清新高端设计 · 苹果风
   ========================================================== */

/* ---------- 新闻页面整体 ---------- */
.news-page {
  background: linear-gradient(180deg, #f8f9fc 0%, #f0f2f8 100%);
  min-height: calc(100vh - 80px);
}

.news-container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 40px 24px 0;
}

/* ---------- 面包屑 ---------- */
.news-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #8a8f9c;
  margin-bottom: 24px;
}
.news-breadcrumb a { color: #8a8f9c; transition: color .2s; }
.news-breadcrumb a:hover { color: var(--blue); }
.news-breadcrumb .sep { opacity: .5; }
.news-breadcrumb .cur { color: var(--text); font-weight: 500; }

/* ---------- 页面标题区 ---------- */
.news-page-header {
  margin-bottom: 32px;
}
.news-page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
.news-page-desc {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-2);
}

/* ---------- 主布局 ---------- */
.news-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
  padding-bottom: 0;
}

@media (max-width: 1024px) {
  .news-layout { grid-template-columns: 1fr; }
}

/* ---------- 左侧主内容 ---------- */
.news-main { min-width: 0; }

/* ---------- 新闻列表卡片 ---------- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-item {
  background: var(--white);
  border-radius: 16px;
  padding: 24px 28px;
  border: 1px solid #eef0f5;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}

.news-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--blue), #5ac8fa);
  opacity: 0;
  transition: opacity .3s;
}

.news-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 113, 227, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  border-color: transparent;
}

.news-item:hover::before { opacity: 1; }

.news-item-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  letter-spacing: .3px;
}

.news-item-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
  transition: color .2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item:hover .news-item-title { color: var(--blue); }

.news-item-desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-3);
}
.news-item-meta span { display: inline-flex; align-items: center; gap: 5px; }
.news-item-meta svg { width: 14px; height: 14px; opacity: .7; }

/* ---------- 分页 ---------- */
.news-pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.news-pagination a,
.news-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  color: var(--text-2);
  background: var(--white);
  border: 1px solid #eef0f5;
  transition: all .2s;
}
.news-pagination a:hover {
  color: var(--blue);
  border-color: var(--blue);
  transform: translateY(-1px);
}
.news-pagination .active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
}

/* ---------- 右侧边栏 ---------- */
.news-side { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 80px; align-self: flex-start; }

.side-card {
  background: var(--white);
  border-radius: 16px;
  padding: 22px 22px 18px;
  border: 1px solid #eef0f5;
}

.side-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f2f5;
}
.side-card-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.side-card-icon.hot { background: linear-gradient(135deg, #ff6b6b, #ff8e53); }
.side-card-icon.rec { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.side-card-icon svg { width: 16px; height: 16px; color: #fff; }

.side-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* 热点排行 */
.hot-list { display: flex; flex-direction: column; gap: 2px; }
.hot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  transition: background .2s;
}
.hot-item:hover { background: #f7f9fc; }
.hot-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.hot-rank {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #f0f2f5;
  color: var(--text-3);
  margin-top: 1px;
}
.hot-item:nth-child(1) .hot-rank { background: linear-gradient(135deg, #ff6b6b, #ff3b30); color: #fff; }
.hot-item:nth-child(2) .hot-rank { background: linear-gradient(135deg, #ff9500, #ff6b00); color: #fff; }
.hot-item:nth-child(3) .hot-rank { background: linear-gradient(135deg, #ffcc00, #ff9500); color: #fff; }

.hot-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s;
}
.hot-item:hover .hot-title { color: var(--blue); }

.hot-views {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------- 底部随机推荐 ---------- */
.news-random {
  margin-top: 48px;
  padding: 36px 0 20px;
  border-top: 1px solid #e6e8ef;
}
.news-random-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.news-random-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.news-random-title::before {
  content: '';
  width: 4px; height: 22px;
  background: linear-gradient(180deg, var(--blue), #5ac8fa);
  border-radius: 2px;
}

.random-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.random-grid .random-card:nth-child(n+9) { display: none; }
@media (max-width: 900px) {
  .random-grid { grid-template-columns: repeat(2, 1fr); }
}

.random-card {
  background: var(--white);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid #eef0f5;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
  display: block;
}
.random-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 113, 227, 0.1);
  border-color: transparent;
}
.random-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 10px;
}
.random-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
}
.random-card:hover .random-title { color: var(--blue); }
.random-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
}

/* ==========================================================
   详情页样式
   ========================================================== */

/* 文章头部 */
.article-head {
  background: var(--white);
  border-radius: 16px;
  padding: 44px 56px;
  border: 1px solid #eef0f5;
  margin-bottom: 24px;
}

.article-head-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 5px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.article-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #f0f2f5;
  font-size: 13px;
  color: var(--text-3);
}
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta svg { width: 14px; height: 14px; opacity: .7; }

/* 文章正文 */
.article-body {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 60px;
  border: 1px solid #eef0f5;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}

.article-body h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 36px 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--blue);
  letter-spacing: -0.01em;
}
.article-body h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 12px;
}
.article-body p { margin: 14px 0; color: #2c2c2e; }
.article-body ul, .article-body ol { margin: 14px 0; padding-left: 24px; }
.article-body li { margin: 8px 0; }
.article-body blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  background: #f7f9fc;
  border-left: 4px solid var(--blue);
  border-radius: 0 10px 10px 0;
  color: var(--text-2);
  font-style: italic;
}
.article-body pre {
  margin: 20px 0;
  padding: 20px;
  background: #1e1e2e;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  color: #cdd6f4;
}
.article-body code {
  font-family: "SF Mono", Monaco, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
}
.article-body p code {
  background: #eef1f8;
  color: var(--blue-dark);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.88em;
}
.article-body table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 14px;
}
.article-body th, .article-body td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eef0f5;
}
.article-body th {
  background: #f7f9fc;
  font-weight: 600;
  color: var(--text-2);
}
.article-body img {
  max-width: 100%;
  border-radius: 12px;
  margin: 20px 0;
}

/* 文章标签 */
.article-tags {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid #f0f2f5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.article-tags a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-2);
  background: #f5f6fa;
  border-radius: 8px;
  transition: all .2s;
}
.article-tags a:hover {
  color: var(--blue);
  background: var(--blue-light);
}

/* 上一篇/下一篇 */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.article-nav a {
  display: block;
  padding: 20px 24px;
  background: var(--white);
  border-radius: 14px;
  border: 1px solid #eef0f5;
  transition: all .3s;
}
.article-nav a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.1);
  border-color: transparent;
}
.article-nav .nav-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.article-nav .nav-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-nav a:hover .nav-title { color: var(--blue); }
.article-nav .nav-next { text-align: right; }
.article-nav .nav-next .nav-label { justify-content: flex-end; }

@media (max-width: 700px) {
  .article-nav { grid-template-columns: 1fr; }
  .article-nav .nav-next { text-align: left; }
  .article-nav .nav-next .nav-label { justify-content: flex-start; }
}

/* 移动端适配 */
@media (max-width: 640px) {
  .news-container { padding: 24px 16px 0; }
  .news-item { padding: 18px 20px; }
  .news-item-title { font-size: 17px; }
  .article-head { padding: 24px 20px; }
  .article-title { font-size: 22px; }
  .article-body { padding: 24px 20px; font-size: 15px; }
  .random-grid { grid-template-columns: 1fr; }
}

/* ---------- 版权声明 ---------- */
.article-disclaimer {
  margin-top: 40px;
  padding: 18px 22px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  border-radius: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.article-disclaimer svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #94a3b8;
  margin-top: 2px;
}

.article-disclaimer p {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.7;
}

.disclaimer-feedback {
  color: #475569;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dashed #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.disclaimer-feedback:hover {
  color: #334155;
  border-bottom-style: solid;
}

/* ---------- 反馈弹窗 ---------- */
.feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.feedback-modal.active {
  display: flex;
}

.feedback-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.feedback-modal-box {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 40px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.feedback-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.2s ease;
}

.feedback-modal-close:hover {
  background: #e2e8f0;
  color: #334155;
  transform: rotate(90deg);
}

.feedback-modal-close svg {
  width: 18px;
  height: 18px;
}

.feedback-modal-title {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

.feedback-field {
  margin-bottom: 16px;
}

.feedback-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.feedback-field .required {
  color: #ef4444;
  margin-left: 2px;
}

.feedback-field input,
.feedback-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
  resize: vertical;
}

.feedback-field input:focus,
.feedback-field textarea:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.feedback-field input[readonly] {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.feedback-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.feedback-submit-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feedback-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.feedback-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .feedback-modal-box { padding: 28px 20px 24px; }
  .feedback-row { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- 首页3列新闻样式（详情页底部复用） ---------- */
.news-home-section {
  padding: 60px 0 72px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.detail-bottom-news {
  padding: 32px 0 56px;
  margin-top: 0;
  background: #f0f2f8;
}
.footer-news {
  padding: 48px 0 40px;
  background: #f0f2f8;
  border-top: 1px solid #e6e8ef;
}
.news-home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}
.news-home-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.news-home-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.news-home-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 24px;
  background: linear-gradient(180deg, #3b82f6, #6366f1);
  border-radius: 3px;
}
.news-home-subtitle {
  font-size: 14.5px;
  color: #64748b;
  margin: 0;
  padding-left: 17px;
}
.news-home-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 13.5px;
  color: #475569;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}
.news-home-more:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}
.news-home-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.news-home-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px 18px;
  border: 1px solid #eef0f5;
  min-width: 0;
}
.news-home-col-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 2px solid #e2e8f0;
}
.news-home-col-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.news-home-col:nth-child(1) .news-home-col-num {
  background: linear-gradient(135deg, #ef4444, #f97316);
}
.news-home-col:nth-child(2) .news-home-col-num {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}
.news-home-col:nth-child(3) .news-home-col-num {
  background: linear-gradient(135deg, #10b981, #06b6d4);
}
.news-home-col-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.news-home-list {
  display: flex;
  flex-direction: column;
  counter-reset: newsRank;
  min-width: 0;
}
.news-home-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  transition: all 0.2s ease;
  counter-increment: newsRank;
}
.news-home-item-rank::before {
  content: counter(newsRank);
}
.news-home-item:last-child {
  border-bottom: none;
}
.news-home-item:hover {
  background: #f8fafc;
  transform: translateX(4px);
  border-radius: 8px;
  border-bottom-color: transparent;
}
.news-home-item:hover .news-home-item-title {
  color: #3b82f6;
}
.news-home-item-rank {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
}
.news-home-list .news-home-item:nth-child(1) .news-home-item-rank {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
}
.news-home-list .news-home-item:nth-child(2) .news-home-item-rank {
  background: linear-gradient(135deg, #f97316, #fbbf24);
  color: #fff;
}
.news-home-list .news-home-item:nth-child(3) .news-home-item-rank {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
}
.news-home-item-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: #334155;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
  font-weight: 500;
}
.news-home-item-views {
  flex-shrink: 0;
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}
@media (max-width: 1100px) {
  .news-home-cols { grid-template-columns: 1fr; gap: 20px; }
}
