/* ============================================================
 * 塔罗牌专用样式
 * ============================================================ */

/* ---------- 页面标题 ---------- */
.page-head {
  text-align: center;
  padding: 1.5rem 0 1.25rem;
}

.page-title {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.page-sub {
  color: var(--text-2);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

/* ---------- 表单字段 ---------- */
.field-label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-2);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

/* ---------- 牌阵选择 ---------- */
.spread-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.spread-item {
  text-align: left;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  color: var(--text);
}

body[data-theme="light"] .spread-item {
  background: rgba(255, 255, 255, 0.5);
}

.spread-item:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.spread-item.active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  box-shadow: 0 0 0 1px var(--gold) inset;
}

.spread-name {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.15rem;
}

.spread-count {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-bottom: 0.35rem;
}

.spread-desc {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* ---------- 操作按钮 ---------- */
.tarot-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.tarot-actions .btn { flex: 1; min-width: 140px; }

/* ---------- 加载动画 ---------- */
.tarot-loading {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-2);
}

.shuffle-anim {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.shuffle-anim span {
  display: inline-block;
  animation: shuffle 1.2s ease-in-out infinite;
}

.shuffle-anim span:nth-child(2) { animation-delay: 0.15s; }
.shuffle-anim span:nth-child(3) { animation-delay: 0.3s; }

@keyframes shuffle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(8deg); }
}

/* ---------- 结果区 ---------- */
.tarot-question {
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--text);
  text-align: center;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: rgba(212, 175, 55, 0.06);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  line-height: 1.7;
}

.tarot-spread-name {
  text-align: center;
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: var(--gold);
  margin-bottom: 1.25rem;
  letter-spacing: 0.1em;
}

/* ---------- 牌面行 ---------- */
.tarot-cards-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tarot-card-slot {
  text-align: center;
  flex: 0 0 auto;
}

.tarot-slot-label {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.tarot-card {
  width: 88px;
  height: 140px;
  border-radius: 10px;
  border: 2px solid var(--gold);
  background: linear-gradient(160deg, rgba(30, 30, 60, 0.95), rgba(20, 20, 40, 0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body[data-theme="light"] .tarot-card {
  background: linear-gradient(160deg, #fffdf7, #f0e8d8);
}

.tarot-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
}

.tarot-card.reversed .tarot-card-inner {
  transform: rotate(180deg);
}

.tarot-card-inner {
  text-align: center;
  padding: 0.5rem;
  transition: transform 0.4s ease;
  width: 100%;
}

.tarot-card-symbol {
  font-size: 1.8rem;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5));
}

.tarot-card-name {
  font-family: var(--font-title);
  font-size: 0.78rem;
  color: var(--gold);
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.tarot-card-pos {
  font-size: 0.65rem;
  color: var(--text-2);
  letter-spacing: 0.05em;
}

.tarot-card.reversed .tarot-card-pos {
  color: var(--cinnabar);
}

/* 按牌组着色边框 */
.tarot-card.tarot-major { border-color: var(--gold); }
.tarot-card.tarot-wands { border-color: #e67e22; }
.tarot-card.tarot-cups { border-color: #3498db; }
.tarot-card.tarot-swords { border-color: #95a5a6; }
.tarot-card.tarot-pentacles { border-color: #27ae60; }

/* ---------- 综合解读 ---------- */
.tarot-overall {
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.overall-head {
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.overall-text {
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--text);
}

/* ---------- 逐张解读 ---------- */
.tarot-readings {
  display: grid;
  gap: 0.85rem;
}

.tarot-reading-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .tarot-reading-wrapper {
  background: rgba(255, 255, 255, 0.5);
}

.reading-position {
  padding: 0.4rem 0.85rem;
  background: rgba(212, 175, 55, 0.1);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--gold);
  font-family: var(--font-title);
  letter-spacing: 0.08em;
}

.tarot-reading-item {
  padding: 0.85rem 1rem;
}

.reading-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.reading-name {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--text);
}

.reading-pos {
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.reading-pos.is-reversed {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
}

.reading-keywords {
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

.reading-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text);
}

/* ---------- 免责 ---------- */
.tarot-disclaimer {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: var(--text-2);
  text-align: center;
  border-top: 1px solid var(--border);
  line-height: 1.7;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .tarot-card {
    width: 72px;
    height: 115px;
  }
  .tarot-card-symbol { font-size: 1.4rem; }
  .tarot-card-name { font-size: 0.7rem; }
  .spread-grid { grid-template-columns: repeat(2, 1fr); }
  .tarot-actions { flex-direction: column; }
  .tarot-actions .btn { width: 100%; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .spread-grid { grid-template-columns: repeat(3, 1fr); }
}
