/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Serif SC', serif;
  background-color: #1a0b2e; /* 深紫色背景 - 替换原有的 #f5f0e1 */
  color: #e0e0e0; /* 浅灰色文本，提高在深色背景上的可读性 */
  line-height: 1.6;
  background-image: url('https://picsum.photos/id/1015/1920/1080');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  background-blend-mode: overlay;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: rgba(26, 11, 46, 0.85); /* 半透明深紫色背景 */
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* 头部样式 */
header {
  text-align: center;
  padding: 40px 20px;
  background-color: #3d1a5f; /* 紫色调头部背景 */
  color: #f0e6f6; /* 浅紫色文本 */
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

header h1 {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 3.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

.card-front p {
    color: #333;
}

/* 主内容区域样式 */
main {
  padding: 20px;
}

.section {
  display: none;
  animation: fadeIn 0.8s ease-in-out;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 2.2rem;
  color: #4a3b76;
  margin-bottom: 25px;
  text-align: center;
  position: relative;
  padding-bottom: 10px;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background-color: #d4af37;
}

/* 欢迎界面样式 */
.welcome-content {
  text-align: center;
  padding: 60px 20px;
  max-width: 600px;
  margin: 0 auto;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.welcome-content h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.welcome-content p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: #555;
}

/* 按钮样式 */
.btn {
  background-color: #8a6bbf;
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  background-color: #6d4caf;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 占卜类型选择样式 */
.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
}

.card {
  perspective: 1000px;
  width: 300px;
  height: 400px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-front {
  background-color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-front img {
  width: 100%;
  height: 70%;
  object-fit: cover;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.card-front h3 {
  padding: 0px 15px;
  font-size: 1.5rem;
  color: #4a3b76;
}

.card-back {
  background-color: #4a3b76;
  color: white;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.card-back p {
  margin-bottom: 20px;
  font-size: 1rem;
}

.select-btn {
  background-color: #d4af37;
  color: #4a3b76;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.select-btn:hover {
  background-color: #f0c846;
  transform: translateY(-3px);
}

/* 问题输入界面样式 */
#question-text {
  width: 100%;
  height: 150px;
  padding: 15px;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 10px;
  margin-bottom: 20px;
  resize: none;
  font-family: 'Noto Serif SC', serif;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

#question-text:focus {
  outline: none;
  border-color: #8a6bbf;
  box-shadow: 0 0 0 3px rgba(138, 107, 191, 0.2);
}

#selected-type-display {
  text-align: center;
  margin-top: 15px;
  font-style: italic;
  color: #666;
}

/* 结果展示界面样式 */
.result-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.result-card {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  max-width: 800px;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#result-image-container {
  width: 100%;
  height: 300px;
  overflow: hidden;
}

#result-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

#result-image:hover {
  transform: scale(1.05);
}

#result-content {
  padding: 30px;
}

#result-title {
  font-size: 1.8rem;
  color: #4a3b76;
  margin-bottom: 15px;
}

#result-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

/* 页脚样式 */
footer {
  text-align: center;
  padding: 20px;
  margin-top: 50px;
  color: #777;
  font-size: 0.9rem;
  border-top: 1px solid #eee;
}

/* 响应式设计 */
@media (max-width: 768px) {
  header h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .card-container {
    flex-direction: column;
    align-items: center;
  }

  .result-card {
    flex-direction: column;
  }

  #result-image-container {
    height: 200px;
  }
}

/* 塔罗牌洗牌动画样式 */
.tarot-shuffle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 30px 0;
}

.tarot-deck {
  position: relative;
  width: 100px;
  height: 150px;
  perspective: 1000px;
}

.tarot-card {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.5s ease;
  backface-visibility: hidden;
}

/* 洗牌动画 */
@keyframes shuffle {
  0% {
    transform: translate(0, 0) rotate(0deg);
    z-index: 1;
  }
  20% {
    transform: translate(-15px, -10px) rotate(-5deg);
    z-index: 3;
  }
  40% {
    transform: translate(15px, 5px) rotate(3deg);
    z-index: 2;
  }
  60% {
    transform: translate(-10px, 10px) rotate(-2deg);
    z-index: 4;
  }
  80% {
    transform: translate(10px, -5px) rotate(4deg);
    z-index: 5;
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
    z-index: 1;
  }
}

.shuffle-animation .tarot-card:nth-child(1) {
  animation: shuffle 1.5s infinite;
  animation-delay: 0s;
}

.shuffle-animation .tarot-card:nth-child(2) {
  animation: shuffle 1.5s infinite;
  animation-delay: 0.2s;
}

.shuffle-animation .tarot-card:nth-child(3) {
  animation: shuffle 1.5s infinite;
  animation-delay: 0.4s;
}

/* 生日输入样式 */
.birthday-input {
  margin: 20px 0;
}

.birthday-input input {
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

.birthday-input input:focus {
  outline: none;
  border-color: #8a6bbf;
  box-shadow: 0 0 0 3px rgba(138, 107, 191, 0.2);
}
