/* 主样式文件 - 塔罗牌占卜应用 */

/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
  background-image: linear-gradient(to bottom, #f9f9f9, #e8e8e8);
  min-height: 100vh;
}

/* 容器样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 页面标题 */
.page-title {
  text-align: center;
  margin-bottom: 30px;
  color: #5a3921;
  font-size: 2.5em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  padding-bottom: 15px;
}

.page-title:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: linear-gradient(to right, #8b4513, #cd853f);
  border-radius: 3px;
}

/* 主内容区域 */
.main-content {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 30px;
  margin-bottom: 30px;
}

/* 卡牌展示区域 */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  border-color: #8b4513;
}

.card.active {
  background: linear-gradient(135deg, #cd5c5c, #8b0000);
  border-color: #8b0000;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(205, 92, 92, 0.3);
}

.card-number {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 5px;
  opacity: 0.8;
}

.card-name {
  font-size: 1.1em;
  font-weight: 500;
}

/* 表单样式 */
.tarot-form {
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #5a3921;
  font-size: 1.1em;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.3s ease;
  background-color: #fafafa;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: #8b4513;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

/* 按钮样式 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, #8b4513, #cd853f);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
  background: linear-gradient(135deg, #a0522d, #d2b48c);
}

.btn-primary:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
  background: linear-gradient(135deg, #868e96, #5a6268);
}

.btn-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* 结果展示区域 */
.result-section {
  margin-top: 30px;
  padding: 25px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 10px;
  border-left: 5px solid #8b4513;
}

.result-title {
  font-size: 1.5em;
  color: #5a3921;
  margin-bottom: 15px;
  font-weight: 600;
}

.result-content {
  font-size: 1.1em;
  line-height: 1.7;
  color: #444;
  white-space: pre-line;
}

/* 选中卡牌展示 */
.selected-cards-section {
  margin: 30px 0;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #eee;
}

.selected-cards-section h3 {
  color: #5a3921;
  margin-bottom: 15px;
  font-size: 1.3em;
}

.selected-cards-grid {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.selected-card-item {
  background-color: white;
  border: 2px solid #8b4513;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  min-width: 100px;
  position: relative;
}

.card-reversed {
  background-color: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.card-reversed::after {
  content: '逆位';
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: #dc3545;
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.7em;
  font-weight: bold;
}

/* 错误提示 */
.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #f5c6cb;
  margin-bottom: 20px;
  font-weight: 500;
}

/* 加载状态 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-content {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #8b4513;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  .page-title {
    font-size: 2em;
  }
  
  .main-content {
    padding: 20px;
  }
  
  .cards-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  
  .btn-container {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.8em;
  }
  
  .cards-container {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .card {
    padding: 10px;
  }
  
  .card-name {
    font-size: 0.9em;
  }
}

/* 页面过渡效果 */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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