body, html {
  margin: 0;
  padding: 0;
  width: 100vw;
  min-height: 700px;
  height: 100vh;
  font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  background: #fff;
  color-scheme: light dark;
}

.container {
  position: relative;
  width: 100vw;
  min-height: 700px;
  height: 100vh;
  background: #fff;
  overflow: auto;
}

.bg {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: #e0e0e6;
  z-index: 1;
}

.card-group {
  position: absolute;
  left: 0;
  right: 0;
  top: 60%;
  transform: translateY(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  width: 100vw;
  overflow: visible;
  pointer-events: none;
  height: 500px;
}

.card-group-inner {
  display: flex;
  flex-direction: row;
  gap: 10px;
  animation: card-scroll 10s linear infinite;
  will-change: transform;
}

.card-group-inner.clone {
  display: none;
}

@keyframes card-scroll {
  0% {
    transform: translateX(100vw);
  }
  100% {
    transform: translateX(-1700px);
  }
}

.card {
  width: 327px;
  height: 420px;
  background: transparent;
  border-radius: 30px;
  flex-shrink: 0;
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}

.card-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4,0.2,0.2,1);
  transform-style: preserve-3d;
  position: relative;
}

.card .card-front,
.card .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}

.card .card-front {
  background: #f3f3f3;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}

.card .card-back {
  background: #ffffff;
  transform: rotateY(180deg);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}

.card.flipped .card-inner {
  transform: rotateY(-180deg);
}

/* 翻转时其他卡片的透明度变化 */
.card-track.dimmed .card:not(.flipped) {
  opacity: 0.5;
  transition: opacity 0.5s ease-in-out;
}

.card-track .card {
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.header {
  position: absolute;
  left: 50%;
  top: 15%;
  transform: translate(-50%, -50%);
  width: 208px;
  height: 200px;
  overflow: hidden;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header-btn {
  background: #1aac6d;
  border-radius: 60px;
  padding: 10px 32px;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  white-space: nowrap;
  margin-bottom: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.header-btn:hover {
  background: #17995e;
  box-shadow: 0 2px 8px rgba(26,172,109,0.15);
}

.header-title {
  color: #000;
  font-size: 24px;
  font-weight: 500;
  font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  white-space: nowrap;
  margin-bottom: 20px;
}

.header-icon {
  width: 48px;
  height: 48px;
  background-image: url('header-icon.svg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 50%;
  margin-bottom: 20px;
}

.card-track {
  display: flex;
  flex-direction: row;
  gap: 10px;
  will-change: transform;
  height: 420px;
  align-items: center;
}

.term-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: auto;
  background: transparent;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
  backface-visibility: hidden;
  opacity: 0;
  animation: fadeIn 0.3s ease-in-out forwards;
}

.term-overlay::-webkit-scrollbar {
  width: 6px;
}

.term-overlay::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.term-overlay::-webkit-scrollbar-thumb {
  background: #1aac6d;
  border-radius: 3px;
}

.term-overlay::-webkit-scrollbar-thumb:hover {
  background: #17995e;
}

.term-title {
  position: absolute;
  top: 15px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #1aac6d;
  font-size: 22px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.term-title.show {
  opacity: 1;
  transform: translateY(0);
}

.term-content {
  color: #333;
  font-size: 18px;
  line-height: 1.6;
  width: 100%;
  text-align: left;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease-in-out;
  max-height: calc(100% - 80px);
  overflow-y: auto;
  padding-right: 10px;
  backface-visibility: hidden;
  margin-top: 5px;
  padding-top: 0;
}

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

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

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

.term-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

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

.term-content::after {
  content: '|';
  animation: blink 1s infinite;
  font-weight: bold;
  color: #1aac6d;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.back-button {
  position: absolute;
  bottom: 24px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 16px;
  color: #1aac6d;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.back-button:hover {
  color: #17995e;
}

/* 深色模式样式 */
@media (prefers-color-scheme: dark) {
  body, html {
    background: #1a1a1a;
  }

  .container {
    background: #1a1a1a;
  }

  .bg {
    background: #222;
  }

  .card .card-front{
    background: #3b3b3b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }
  .card .card-back {
    background: #4e4e4e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }

  .header-title {
    color: #fff;
  }

  .header-icon {
    filter: invert(1);
  }

  .term-content {
    color: #e0e0e0;
  }

  .term-title {
    color: #4caf50;
  }

  .back-button,
  .ask-btn {
    color: #4caf50;
  }

  .back-button:hover,
  .ask-btn:hover {
    color: #66bb6a;
  }

  .header-btn {
    background: #4caf50;
  }

  .header-btn:hover {
    background: #66bb6a;
    box-shadow: 0 2px 8px rgba(76,175,80,0.3);
  }
} 