/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4F46E5;
  --secondary-color: #06B6D4;
  --text-color: #1F2937;
  --text-light: #6B7280;
  --bg-color: #F9FAFB;
  --card-bg: #FFFFFF;
  --border-color: #E5E7EB;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

/* 页头 */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 2rem 0;
  box-shadow: var(--shadow-md);
}

header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1.125rem;
  opacity: 0.9;
}

/* 导航 */
nav {
  background: white;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

nav .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 2rem;
}

nav a {
  display: inline-block;
  padding: 1rem 0;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

nav a:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

/* 日期卡片 */
.date-card {
  background: var(--card-bg);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.date-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.date-card a {
  text-decoration: none;
  color: inherit;
}

.date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.date-header h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.news-count {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.category-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* 资讯分类区域 */
.category-section {
  margin-bottom: 3rem;
}

.category-section h2 {
  font-size: 1.875rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 资讯网格 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.news-card {
  background: var(--card-bg);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.news-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.news-header {
  margin-bottom: 1rem;
}

.news-header h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.news-header h3 a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.news-header h3 a:hover {
  color: var(--primary-color);
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-light);
  font-size: 0.875rem;
}

.stars {
  color: #F59E0B;
}

.news-summary {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.news-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.source {
  color: var(--text-light);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  color: var(--primary-color);
}

/* 资讯详情页 */
.news-detail {
  background: var(--card-bg);
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.news-detail-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.news-detail-header h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.news-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: var(--text-light);
  font-size: 0.875rem;
}

.news-detail-meta > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-tag {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-weight: 600;
  color: white;
}

.news-content {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.news-content h1 {
  font-size: 1.875rem;
  margin: 2rem 0 1rem;
  color: var(--text-color);
}

.news-content h2 {
  font-size: 1.5rem;
  margin: 1.75rem 0 0.875rem;
  color: var(--text-color);
}

.news-content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-color);
}

.news-content p {
  margin-bottom: 1rem;
}

.news-content ul, .news-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.news-content li {
  margin-bottom: 0.5rem;
}

.news-content code {
  background: var(--bg-color);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
}

.news-content pre {
  background: var(--bg-color);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  max-width: 100%;
}

.news-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875em;
  white-space: pre;
  word-wrap: normal;
}

.news-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-light);
  font-style: italic;
}

/* 表格容器，支持横向滚动 */
.news-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.news-content table tbody,
.news-content table thead {
  display: table;
  width: 100%;
}

.news-content th, .news-content td {
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: left;
  min-width: 100px;
}

.news-content th {
  background: var(--bg-color);
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.back-link:hover {
  transform: translateX(-4px);
}

/* 页脚 */
footer {
  background: white;
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
  color: var(--text-light);
  text-align: center;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* 响应式设计 */

/* 小屏手机 (320px - 374px) */
@media (max-width: 374px) {
  header h1 {
    font-size: 1.5rem;
  }

  header p {
    font-size: 0.875rem;
  }

  header .container,
  .container {
    padding: 0 1rem;
  }

  nav .container {
    padding: 0 1rem;
    gap: 1rem;
  }

  nav a {
    font-size: 0.875rem;
    padding: 0.75rem 0;
  }

  .date-card {
    padding: 1rem;
  }

  .news-card {
    padding: 1rem;
  }

  .news-content {
    font-size: 1rem;
  }

  .news-content pre {
    padding: 0.75rem;
    font-size: 0.8125rem;
  }

  .news-content table th,
  .news-content table td {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}

/* 中等手机和小平板 (375px - 768px) */
@media (min-width: 375px) and (max-width: 768px) {
  header h1 {
    font-size: 1.875rem;
  }

  header .container,
  .container {
    padding: 0 1.25rem;
  }

  nav .container {
    padding: 0 1.25rem;
    gap: 1.5rem;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .date-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .news-detail {
    padding: 1.5rem;
  }

  .news-detail-header h1 {
    font-size: 1.5rem;
  }

  .news-detail-meta {
    flex-direction: column;
    gap: 0.75rem;
  }

  .news-content pre {
    padding: 0.875rem;
  }
}

/* 通用移动端优化 (最大 768px) */
@media (max-width: 768px) {
  header h1 {
    line-height: 1.2;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .news-card {
    border-radius: 0.5rem;
  }

  .news-header h3 {
    font-size: 1.125rem;
  }

  .news-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .news-content h1 {
    font-size: 1.5rem;
  }

  .news-content h2 {
    font-size: 1.25rem;
  }

  .news-content h3 {
    font-size: 1.125rem;
  }

  .news-content ul,
  .news-content ol {
    padding-left: 1.5rem;
  }

  .category-section {
    margin-bottom: 2rem;
  }

  .category-section h2 {
    font-size: 1.5rem;
  }
}

/* 加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* 工具类 */
.text-center {
  text-align: center;
}

.mb-4 {
  margin-bottom: 2rem;
}

.mt-4 {
  margin-top: 2rem;
}

