/**
 * 答案之书页面样式
 */

/* 主页面容器 */
.answer-book-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #2D1B69 0%, #11082A 100%);
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #333;
}

/* 页面头部 */
.ab-header {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 20px;
}

.ab-header .page-title {
  color: white;
  font-size: 32px;
  font-weight: bold;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 12px;
}

.ab-header .header-subtitle {
  color: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 加载状态样式 */
.ab-loading-section {
  max-width: 500px;
  margin: 0 auto;
  padding: 40px 0;
}

.ab-loading-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 50px 30px;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.ab-loading-icon {
  font-size: 80px;
  margin-bottom: 24px;
  animation: bookFlip 2s ease-in-out infinite;
}

@keyframes bookFlip {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

.ab-loading-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 16px;
}

.ab-loading-description {
  font-size: 16px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 30px;
}

.ab-loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(248, 93, 251, 0.2);
  border-top-color: #f85dfb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 内容区域 */
.ab-content-section {
  max-width: 600px;
  margin: 0 auto;
}

.ab-book-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

/* 区块标题 */
.ab-section-title {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 动作部分 */
.ab-action-section {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 2px solid rgba(248, 93, 251, 0.15);
}

.ab-action-lines {
  background: linear-gradient(135deg, rgba(248, 93, 251, 0.08) 0%, rgba(245, 87, 108, 0.08) 100%);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
}

.ab-action-line {
  font-size: 20px;
  color: #333;
  line-height: 1.8;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 4px 0;
}

/* 答案部分 */
.ab-answer-section {
  margin-bottom: 32px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 答案已揭晓状态 */
.ab-answer-section.ab-revealed .ab-answer-lines {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 165, 0, 0.12) 100%);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  animation: revealAnswer 0.6s ease-out;
}

@keyframes revealAnswer {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ab-answer-line {
  font-size: 22px;
  color: #d4620f;
  line-height: 1.8;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 0;
}

/* 答案隐藏状态 */
.ab-answer-section.ab-hidden {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ab-mystery-cover {
  background: linear-gradient(135deg, rgba(156, 136, 255, 0.15) 0%, rgba(124, 75, 162, 0.15) 100%);
  border: 2px dashed rgba(156, 136, 255, 0.4);
  border-radius: 16px;
  padding: 40px 30px;
  text-align: center;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ab-mystery-cover:hover {
  background: linear-gradient(135deg, rgba(156, 136, 255, 0.2) 0%, rgba(124, 75, 162, 0.2) 100%);
  border-color: rgba(156, 136, 255, 0.6);
  transform: scale(1.02);
}

.ab-mystery-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: mysteryPulse 2s ease-in-out infinite;
}

@keyframes mysteryPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

.ab-mystery-text {
  font-size: 18px;
  color: #7c4ba2;
  font-weight: 600;
  letter-spacing: 1px;
}

/* 操作按钮 */
.ab-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.ab-btn {
  padding: 16px 40px;
  border: none;
  border-radius: 28px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.5px;
}

.ab-btn-primary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.ab-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(248, 93, 251, 0.4);
}

.ab-btn-primary:active {
  transform: translateY(0);
}

.ab-btn-secondary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.ab-btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(118, 75, 162, 0.4);
}

.ab-btn-secondary:active {
  transform: translateY(0);
}

/* 空状态 */
.ab-empty-section {
  max-width: 500px;
  margin: 40px auto;
}

.ab-empty-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 60px 30px;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.ab-empty-icon {
  font-size: 80px;
  margin-bottom: 24px;
  opacity: 0.8;
}

.ab-empty-title {
  font-size: 20px;
  font-weight: 600;
  color: #666;
  margin-bottom: 30px;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .answer-book-page {
    padding: 15px;
  }

  .ab-book-card {
    padding: 30px 20px;
  }

  .ab-header .page-title {
    font-size: 28px;
  }

  .ab-action-line,
  .ab-answer-line {
    font-size: 18px;
  }

  .ab-btn {
    padding: 14px 32px;
    font-size: 16px;
  }
}
