/* 基础样式重置和变量定义 */
:root {
  --card-radius: 12px;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --transition: transform 0.2s ease;
  --font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --section-gap: 15px;
  --card-height: 400px;  /* 统一卡片高度 */
  --header-height: 50px; /* 卡片标题高度 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: #2c3e50;
  background: #f5f7fa;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

/* 容器样式优化 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--section-gap);
}

/* 头部区域样式优化 */
.header {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--theme-color) 0%, #1565c0 100%);
  color: #fff;
  padding: 30px;
  text-align: center;
  border-radius: var(--card-radius);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--section-gap);
}

.header h1 {
  font-size: 2.4em;
  font-weight: 600;
  margin-bottom: 15px;
  letter-spacing: 1px;
}

.header .date {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.header .solar {
  font-size: 1.2em;
  opacity: 0.95;
}

.header .lunar {
  font-size: 1.1em;
  opacity: 0.85;
  display: flex;
  gap: 15px;
}

/* 优化头部背景，移除复杂的SVG背景 */
.header::before {
  display: none;
}

/* 恢复每日一语的优雅样式 */
.header .daily-quote {
  margin: 20px auto 0;
  padding: 20px;
  max-width: 800px;
  border-top: 1px solid rgba(255,255,255,0.1);
  position: relative;
  will-change: transform, opacity;
}

/* 添加引号装饰 */
.header .daily-quote::before,
.header .daily-quote::after {
  content: '"';
  position: absolute;
  font-size: 4em;
  font-family: Georgia, serif;
  opacity: 0.2;
  line-height: 1;
}

.header .daily-quote::before {
  left: 0;
  top: 10px;
  transform: translateX(-50%);
}

.header .daily-quote::after {
  right: 0;
  bottom: -20px;
  transform: translateX(50%);
}

/* 每日一语文本样式 */
.header .daily-quote p {
  font-size: 1.1em;
  line-height: 1.8;
  opacity: 0.95;
  font-weight: 300;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
  padding: 0 30px;
}

/* 添加淡入动画 */
.header .daily-quote {
  animation: fadeInQuote 1s ease-out;
}

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

/* 响应式调整 */
@media (max-width: 768px) {
  .header .daily-quote {
    margin-top: 15px;
    padding: 15px 10px;
  }
  
  .header .daily-quote p {
    font-size: 1em;
    line-height: 1.6;
    padding: 0 20px;
  }
  
  .header .daily-quote::before,
  .header .daily-quote::after {
    font-size: 3em;
  }
}

/* 修改历史上的今天的样式 - 移除排行色彩 */
.list-item .index {
  width: 60px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  background: rgba(var(--theme-rgb), 0.1);
  border-radius: 4px;
  color: var(--theme-color);
  font-size: 13px;
  font-weight: normal;
}

/* 历史上的今天取消排行样式 */
.list-item:nth-child(1) .index,
.list-item:nth-child(2) .index,
.list-item:nth-child(3) .index {
  background: rgba(var(--theme-rgb), 0.1);
  color: var(--theme-color);
}

/* 优化今日黄历样式 */
.lunar-section {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.lunar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px;
}

.lunar-item {
  flex: 1;
  min-width: 200px;
  padding: 10px 15px;
  background: #fff;
  border: 1px solid rgba(var(--theme-rgb), 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.lunar-item .label {
  font-weight: 500;
  margin-right: 15px;
  color: #666;
  font-size: 14px;
  min-width: 40px;
}

.lunar-item .value {
  color: #333;
  font-size: 14px;
  flex: 1;
}

/* 宜忌样式优化 */
.lunar-item.yi,
.lunar-item.ji {
  flex: 2;
  min-width: 300px;
}

.lunar-item.yi .label {
  color: #52c41a;
}

.lunar-item.ji .label {
  color: #ff4d4f;
}

.lunar-item.yi .value,
.lunar-item.ji .value {
  white-space: normal;
  line-height: 1.8;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .lunar-item {
    min-width: 150px;
  }
  
  .lunar-item.yi,
  .lunar-item.ji {
    min-width: 100%;
  }
}

/* 卡片基础样式 */
.card {
  height: auto; /* 改为自适应高度 */
  min-height: 300px; /* 设置最小高度 */
  max-height: 600px; /* 设置最大高度 */
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* 卡片标题样式 */
.section-title {
  height: var(--header-height);
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.section-title h2 {
  font-size: 1.1em;
  color: var(--theme-color);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title img {
  margin-right: 12px;
  border-radius: 4px;
}

/* 卡片内容区域 */
.section-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) transparent;
  -webkit-overflow-scrolling: touch;
  backface-visibility: hidden;
}

/* 自定义滚动条样式 */
.section-content::-webkit-scrollbar {
  width: 6px;
}

.section-content::-webkit-scrollbar-track {
  background: transparent;
}

.section-content::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 3px;
}

/* 列表项基础样式 */
.list-item, .hot-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: var(--transition);
  white-space: nowrap; /* 防止换行 */
}

.list-item:hover, .hot-item:hover {
  background: rgba(var(--theme-rgb), 0.03);
  will-change: transform;
}

/* 内容区域样式 */
.list-item .content, .hot-content {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis; /* 超出显示省略号 */
  white-space: nowrap;
  margin-right: 15px;
  font-size: 14px;
  color: #2c3e50;
}

/* 热度分数样式 */
.hot-score {
  min-width: 40px; /* 压缩热度数值的空间 */
  font-size: 13px;
  color: #f44336;
  font-weight: 500;
  flex-shrink: 0;
  text-align: right;
}

/* 热点内容特殊样式 */
.hot-item {
  border: none;
  margin-bottom: 1px;
}

.hot-content {
  display: flex;
  align-items: center;
}

/* 网页上的热搜内容显示 - 适用于所有设备 */
.hot-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: #2c3e50;
  padding-right: 15px;
  max-width: calc(100% - 45px); /* 增加标题显示区域 */
  min-width: 280px; /* 确保至少显示20个字 */
}

.hot-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: fit-content;
}

.hot-tag {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(var(--theme-rgb), 0.1);
  color: var(--theme-color);
  font-size: 12px;
}

/* 移除之前的一些样式 */
.hot-desc {
  display: none;
}

.hot-score::before {
  display: none;
}

/* 修改保存按钮样式 */
.save-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 12px 20px;
  background: var(--theme-color);
  color: #fff;
  border-radius: 25px;
  box-shadow: 0 4px 12px rgba(var(--theme-rgb), 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  z-index: 100;
}

.save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--theme-rgb), 0.4);
}

.save-btn svg {
  transition: transform 0.3s ease;
}

.save-btn:hover svg {
  transform: translateY(-2px);
}

.save-btn.loading {
  opacity: 0.8;
  cursor: wait;
}

/* 加载动画 */
@keyframes saving {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.save-btn.loading {
  animation: saving 1s infinite;
}

/* 确保图片能够正确加载 */
img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  content-visibility: auto;
}

/* 前10条热搜的容器 */
.hot-list-top {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* 热搜序号样式 */
.hot-index {
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  background: #f0f7ff;
  border-radius: 6px;
  margin-right: 12px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  color: #666;
}

/* 热搜前三名样式 */
.hot-item:nth-child(1) {
  background: #fff8f8;
}

.hot-item:nth-child(1) .hot-index {
  background: #f44336;
  color: #fff;
}

.hot-item:nth-child(2) {
  background: #fff8f5;
}

.hot-item:nth-child(2) .hot-index {
  background: #ff5722;
  color: #fff;
}

.hot-item:nth-child(3) {
  background: #fffaf2;
}

.hot-item:nth-child(3) .hot-index {
  background: #ff9800;
  color: #fff;
}

/* 4-10名序号样式 */
.hot-item:nth-child(n+4):nth-child(-n+10) .hot-index {
  background: rgba(var(--theme-rgb), 0.1);
  color: var(--theme-color);
}

/* 其他序号样式保持默认 */
.hot-item:nth-child(n+11) .hot-index {
  background: #f5f5f5;
  color: #666;
}

/* 保持列表项hover效果 */
.hot-item:hover {
  background: rgba(var(--theme-rgb), 0.03);
  transform: translateX(5px);
}

/* 添加加载动画容器 */
.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-container.active {
  display: flex;
}

/* 加载动画 */
.loading-spinner {
  width: 120px;
  padding: 15px;
  background: white;
  border-radius: 12px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 10px auto;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--theme-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 海报样式优化 */
.poster-container {
  max-width: 750px;
  width: 100%;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin: 0 auto;
}

/* 海报分类标题样式 */
.poster-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--theme-color);
  margin: 20px 0 15px;
  padding-left: 12px;
  border-left: 4px solid var(--theme-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.poster-section-title img {
  height: 20px;
  width: auto;
}

/* 海报列表样式 */
.poster-list {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.poster-list .hot-item {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.poster-list .hot-item:last-child {
  border-bottom: none;
}

/* 移动端海报样式优化 */
@media (max-width: 768px) {
  body {
    padding: 0;
    margin: 0;
    width: 100vw;
    overflow-x: hidden;
  }

  .container {
    padding: 10px 15px; /* 统一左右边距 */
    margin: 0;
    width: 100%;
    max-width: 100%;
    display: block;
  }

  .card {
    width: 100%;
    margin: 0 0 15px 0;
  }

  /* 调整内容边距 */
  .section-content {
    padding: 10px 15px; /* 统一左右边距 */
  }

  .hot-item {
    padding: 10px 15px; /* 统一左右边距 */
  }

  /* 优化海报在移动端的显示 */
  .poster-container {
    width: 100%;
    padding: 8px;
    padding-bottom: 0; /* 移除底部内边距 */
    margin: 0;
    border-radius: 6px;
    overflow: hidden; /* 确保内容不会溢出 */
  }

  .poster-content {
    padding: 0;
    margin-bottom: 0; /* 移除底部边距 */
  }

  /* 调整最后一个列表项 */
  .poster-list:last-child {
    margin-bottom: 0;
  }

  /* 优化海报头部 */
  .poster-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .poster-header h1 {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .poster-header .date {
    font-size: 12px;
    gap: 2px;
  }

  /* 优化分类标题 */
  .poster-section-title {
    font-size: 14px;
    margin: 8px 0 6px;
    padding-left: 6px;
    border-left: 3px solid var(--theme-color);
  }

  .poster-section-title img {
    height: 14px;
  }

  /* 优化列表样式 */
  .poster-list {
    margin-bottom: 8px;
  }

  .poster-list .hot-item {
    padding: 6px 8px;
    gap: 4px;
  }

  .hot-index {
    width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 11px;
    margin-right: 6px;
  }

  /* 海报中的内容显示 */
  .poster-list .hot-title {
    font-size: 12px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
    max-width: calc(100% - 70px); /* 调整海报中标题显示空间 */
  }

  .poster-list .hot-meta {
    font-size: 10px;
    flex-shrink: 0;
    min-width: fit-content;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .poster-list .hot-score {
    flex-shrink: 0;
    min-width: 35px;
    text-align: right;
  }

  .poster-list .hot-tag {
    flex-shrink: 0;
    max-width: 35px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 1px 3px;
    font-size: 9px;
  }

  /* 网页显示的内容 - 确保显示更多文字 */
  .hot-item:not(.poster-list .hot-item) .hot-title {
    max-width: calc(100% - 45px); /* 增加标题显示区域 */
    font-size: 14px;
    min-width: 280px; /* 确保至少显示20个字 */
  }

  .hot-item:not(.poster-list .hot-item) .hot-meta {
    gap: 4px;
  }

  .hot-item:not(.poster-list .hot-item) .hot-score {
    min-width: 40px; /* 压缩热度数值的空间 */
  }

  /* 优化页脚样式 */
  .poster-footer {
    margin: 8px -8px 0; /* 修改底部边距 */
    padding: 8px;
    border-radius: 8px;
    background: #f8f9fa;
    border-bottom: none; /* 移除底部边框 */
  }

  .poster-info .title {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .poster-info .desc {
    font-size: 10px;
  }

  .poster-qrcode {
    width: 50px;
    height: 50px;
  }
}

/* 海报头部样式优化 */
.poster-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.poster-header h1 {
  font-size: 24px;
  color: var(--theme-color);
  margin-bottom: 10px;
  text-align: center;
  width: 100%;
}

.poster-header .date {
  font-size: 14px;
  color: #666;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.poster-header .date span {
  text-align: center;
  display: inline-block;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .poster-header h1 {
    font-size: 20px;
  }
  
  .poster-header .date {
    font-size: 13px;
  }
}

/* 海报内容样式 */
.poster-content {
  padding: 0 15px;
}

/* 海报底部样式 */
.poster-footer {
  margin-top: 20px;
  padding: 15px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
  border-radius: 8px;
}

.poster-info {
  flex: 1;
  padding-right: 15px;
}

.poster-info .title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
}

.poster-info .desc {
  font-size: 12px;
  color: #666;
}

.poster-qrcode {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
} 