:root {
  --primary-color: #2c5282; /* 深蓝主色 */
  --accent-color: #e53e3e; /* 点缀红色 */
  --gradient-start: #2c5282; /* 渐变起始色 */
  --gradient-end: #4299e1; /* 渐变结束色 */
  --bg-light: #f7fafc; /* 浅色背景 */
  --text-primary: #2d3748; /* 主要文字颜色 */
  --text-secondary: #4a5568; /* 次要文字颜色 */
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  margin: 0;
  padding: 0;
  background: #f0f2f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.container {
  background: linear-gradient(
    135deg,
    var(--gradient-start) 0%,
    var(--gradient-end) 100%
  );
  min-height: 100vh;
  padding: 15px;
}

.news-card {
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(44, 82, 130, 0.2);
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
}

.card-header {
  background: linear-gradient(
    to right,
    var(--primary-color) 0%,
    var(--gradient-end) 100%
  );
  padding: 15px 10px 10px;
  border-bottom: none;
  color: white;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.title {
  display: flex;
  align-items: center;
  position: relative;
  padding-bottom: 8px;
}

.title-today {
  font-size: 42px;
  font-weight: bold;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  margin-right: 3px;
}

.title-trade {
  font-size: 42px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.title::after {
  content: none;
}

.title-decoration {
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 215, 0, 0.15);
  overflow: hidden;
}

.title-decoration::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    #ffd700 20%,
    #ffd700 80%,
    transparent
  );
  border-radius: 2px;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
  animation: glowingBar 3s ease-in-out infinite;
}

@keyframes glowingBar {
  0% {
    left: -50%;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

.date-box,
.subtitle {
  background-color: rgba(255, 255, 255, 0.15);
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(5px);
  color: white;
  min-width: 120px;
  text-align: center;
}

.subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 15px;
  margin-top: 5px;
  border-radius: 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.95);
}

.date-box .year {
  color: #ffd700;
  font-weight: bold;
}

.exchange-rate {
  background: rgba(255, 255, 255, 0.15);
  padding: 8px;
  border-radius: 16px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(5px);
  margin-top: 8px;
}

.exchange-rate-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.exchange-rate-row:first-child {
  margin-bottom: 8px;
}

.rate-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 10px;
  transition: all 0.3s ease;
  gap: 2px;
}

.rate-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.currency {
  display: flex;
  align-items: center;
  gap: 6px;
}

.flag {
  font-size: 22px;
  line-height: 1;
}

.currency-code {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.rate {
  color: #ffd700;
  font-family: monospace;
  font-size: 16px;
  text-align: center;
  font-weight: 600;
}

.card-body {
  padding: 8px;
  background: linear-gradient(to bottom, #f8fafc, #ffffff);
  height: 586px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.news-list {
  font-size: 16px;
  line-height: 1.5;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 4px;
  position: relative;
}

.news-list::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 40%,
    rgba(255, 255, 255, 1) 100%
  );
  pointer-events: none;
}

.news-item {
  padding: 4px 10px;
  padding-left: 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 2px 6px rgba(44, 82, 130, 0.08);
  font-weight: 500;
}

.news-item:nth-child(3n + 1) {
  background: rgba(236, 246, 255, 0.95);
}

.news-item:nth-child(3n + 2) {
  background: rgba(240, 255, 244, 0.95);
}

.news-item:nth-child(3n + 3) {
  background: rgba(255, 247, 237, 0.95);
}

.news-item:nth-child(3n + 1)::before {
  background: linear-gradient(to bottom, #3182ce, #4299e1);
}

.news-item:nth-child(3n + 2)::before {
  background: linear-gradient(to bottom, #48bb78, #68d391);
}

.news-item:nth-child(3n + 3)::before {
  background: linear-gradient(to bottom, #ed8936, #f6ad55);
}

.news-item:hover {
  background: rgba(255, 247, 237, 1);
  border-color: rgba(237, 137, 54, 0.2);
  box-shadow: 0 4px 12px rgba(237, 137, 54, 0.12);
}

.news-item:last-child {
  margin-bottom: 0;
}

.card-footer {
  background: var(--bg-light);
  padding: 8px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  position: relative;
}

.footer-text {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.footer-text:hover {
  color: var(--primary-color);
}

.footer-text::before {
  content: "📱";
  font-size: 17px;
  margin-right: 8px;
}

.kf-qrcode {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
  margin-bottom: 10px;
}

.kf-qrcode::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: white transparent transparent transparent;
}

.kf-qrcode img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.footer-text:hover .kf-qrcode {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 5px);
}

.flag-wrapper {
  width: 24px;
  height: 18px;
  position: relative;
  overflow: hidden;
}

.flag-icon {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
}

.flag-icon svg {
  width: 100%;
  height: 100%;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: white;
  margin-top: 15px;
  font-size: 16px;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .flag-wrapper {
    width: 20px;
    height: 15px;
  }
}

/* 导航箭头样式 */
.nav-arrows {
  position: absolute;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  box-sizing: border-box;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 10;
  left: 0;
}

.nav-arrow {
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
}

.nav-arrow svg {
  width: 24px;
  height: 24px;
  fill: #333;
}

/* 为左右箭头分别设置内边距 */
.nav-arrow.left svg {
  margin-right: 2px;
}

.nav-arrow.right svg {
  margin-left: 2px;
}

/* 修改这里：只在鼠标悬停在箭头上时显示 */
.nav-arrow:hover {
  opacity: 1;
  background-color: #fff;
}

/* 导航箭头禁用状态 */
.nav-arrow.disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.nav-arrow.disabled:hover {
  opacity: 0;
}

.nav-arrow:hover:not(.disabled) {
  opacity: 1;
  background-color: #fff;
}

.nav-arrow.disabled svg {
  fill: #999;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  transition: transform 0.3s ease-in-out;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

// 滚动条样式
::-webkit-scrollbar {
  width: 8px; /* 滚动条宽度 */
  height: 8px; /* 水平滚动条高度 */
}

::-webkit-scrollbar-track {
  background: #f1f1f1; /* 滚动条轨道颜色 */
}

::-webkit-scrollbar-thumb {
  background: #888; /* 滚动条颜色 */
  border-radius: 4px; /* 圆角 */
}

::-webkit-scrollbar-thumb:hover {
  background: #555; /* 滚动条悬停颜色 */
}
