/* 基础样式 */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f8f5ff 0%, #fff 100%);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

.main-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部样式 */
.header {
  text-align: center;
  margin-bottom: 30px;
  padding: 25px;
  background: linear-gradient(135deg, #9c27b0, #673ab7);
  color: white;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(156, 39, 176, 0.15);
}

.header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
}

.subtitle {
  margin: 10px 0 0;
  font-size: clamp(1rem, 3vw, 1.2rem);
  opacity: 0.9;
}

/* 内容区域 */
.content {
  flex: 1;
  background: white;
  padding: clamp(20px, 4vw, 30px);
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 介绍部分 */
.introduction {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f5ff;
  border-radius: 12px;
  line-height: 1.8;
}

/* 开始按钮 */
.start-btn {
  display: inline-block;
  padding: 15px 40px;
  margin-top: 20px;
  background: #9c27b0;
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(156, 39, 176, 0.2);
}

.start-btn:hover {
  background: #7b1fa2;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(156, 39, 176, 0.3);
}

/* 进度条 */
.progress-bar {
  margin: 30px 0;
  padding: 0 10px;
}

.progress-text {
  text-align: center;
  margin-bottom: 15px;
  color: #666;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.progress-line {
  height: 8px;
  background: #f3e5f5;
  border-radius: 4px;
  overflow: hidden;
}

.progress-inner {
  height: 100%;
  background: linear-gradient(90deg, #9c27b0, #673ab7);
  width: 0;
  transition: width 0.4s ease;
}

/* 问题容器 */
.question-container {
  margin: 30px 0;
  min-height: 200px;
  padding: 0 10px;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 选项按钮 */
.option-btn {
  padding: clamp(20px, 5vw, 25px);
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  text-align: left;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  transition: all 0.3s ease;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0.3px;
}

.option-btn:hover {
  background: #f3e5f5;
  border-color: #9c27b0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.15);
}

.option-btn.selected {
  background: #f3e5f5;
  border-color: #9c27b0;
  color: #9c27b0;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.15);
}

/* 导航按钮 */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding: 0 10px;
  gap: 15px;
}

.nav-btn,
.submit-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  transition: all 0.3s ease;
  min-width: 120px;
}

.prev-btn {
  background: #f3e5f5;
  color: #9c27b0;
}

.prev-btn:hover {
  background: #e1bee7;
  transform: translateX(-2px);
}

.next-btn,
.submit-btn {
  background: #9c27b0;
  color: white;
}

.next-btn:hover,
.submit-btn:hover {
  background: #7b1fa2;
  transform: translateX(2px);
}

.next-btn.disabled,
.submit-btn.disabled {
  background: #e0e0e0;
  cursor: not-allowed;
  transform: none;
}

.next-btn.disabled:hover,
.submit-btn.disabled:hover {
  background: #e0e0e0;
  transform: none;
}

/* 结果页面样式 */
.loading-container {
  text-align: center;
  padding: clamp(30px, 8vw, 60px) 0;
}

.loading-spinner {
  width: clamp(40px, 8vw, 60px);
  height: clamp(40px, 8vw, 60px);
  border: 4px solid #f3e5f5;
  border-top: 4px solid #9c27b0;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: #666;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
}

.result-content {
  text-align: center;
  padding: clamp(20px, 4vw, 30px);
}

.result-content h2 {
  color: #9c27b0;
  margin-bottom: 30px;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.qrimage {
  margin: 30px auto;
  max-width: clamp(150px, 40vw, 200px);
  padding: 15px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.qrimage img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.hash-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 25px auto;
  max-width: 400px;
  background: #f3e5f5;
  padding: clamp(8px, 3vw, 12px);
  border-radius: 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hash-code {
  padding: 0;
  margin: 0;
  background: transparent;
  font-family: monospace;
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: #9c27b0;
  flex: 1;
  text-align: center;
}

.copy-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #9c27b0;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
}

.copy-btn svg {
  width: clamp(18px, 5vw, 24px);
  height: clamp(18px, 5vw, 24px);
}

.copy-btn:hover {
  color: #7b1fa2;
  transform: scale(1.1);
}

.copy-btn.copied {
  color: #4caf50;
}

/* 复制成功提示 */
.copy-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(76, 175, 80, 0.9);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
  margin-bottom: 8px;
  animation: fadeInOut 1.5s ease;
}

.copy-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(76, 175, 80, 0.9);
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}

.retry-btn {
  margin-top: 30px;
  padding: clamp(10px, 3vw, 15px) clamp(20px, 5vw, 30px);
  background: #9c27b0;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(156, 39, 176, 0.2);
}

.retry-btn:hover {
  background: #7b1fa2;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(156, 39, 176, 0.3);
}

/* 页脚 */
.footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  color: #666;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
}

/* 移动端适配 */
@media (max-width: 600px) {
  .main-container {
    padding: 15px;
  }

  .content {
    padding: 15px;
  }

  .navigation-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .nav-btn,
  .submit-btn {
    width: 100%;
    min-width: unset;
  }

  .hash-container {
    margin: 25px 15px;
  }

  .option-btn {
    padding: 18px;
    font-size: 1rem;
  }
}

/* 未答题提示 */
.answer-tooltip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(156, 39, 176, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  animation: fadeInOut 1.5s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
