/* ========== 塔罗占卜页 ========== */
.taluo-wrap { max-width: 1100px; margin: 0 auto; }

/* 设置区 */
.taluo-setup {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 26px 28px;
  margin-bottom: 24px;
}
.taluo-field { margin-bottom: 24px; }
.taluo-field:last-child { margin-bottom: 0; }

/* 牌阵选择 */
.spread-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.spread-option {
  background: rgba(20,20,45,0.5);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
}
.spread-option:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3), 0 0 12px rgba(212,168,67,0.12);
}
.spread-option.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(212,168,67,0.18), rgba(212,168,67,0.05));
  box-shadow: 0 0 0 1px var(--gold), 0 6px 18px rgba(212,168,67,0.15);
}
.sp-name {
  font-size: 15px;
  color: var(--gold-light);
  letter-spacing: 2px;
  margin-bottom: 6px;
  font-weight: bold;
}
.spread-option.active .sp-name { color: var(--gold); }
.sp-count {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.sp-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 主题选择 */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.theme-option {
  background: rgba(20,20,45,0.5);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 13px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 3px;
}
.theme-option:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-1px);
}
.theme-option.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--bg-1);
  font-weight: bold;
  box-shadow: 0 4px 14px rgba(212,168,67,0.3);
}

/* 问题输入 */
.taluo-question {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  background: rgba(20,20,45,0.6);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  letter-spacing: 1px;
  transition: border-color 0.2s;
}
.taluo-question::placeholder { color: var(--text-dim); }
.taluo-question:focus { border-color: var(--gold); }

/* 抽牌按钮 */
.taluo-actions { text-align: center; margin-top: 28px; }
.taluo-draw-btn {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--bg-1);
  border: none;
  padding: 14px 52px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 6px;
  transition: all 0.3s;
  font-family: inherit;
}
.taluo-draw-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212,168,67,0.4);
}
.taluo-draw-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 仪式区（静心 + 洗牌） */
.taluo-ritual {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 70px 20px;
  min-height: 320px;
}
.taluo-ritual.show { display: flex; }
.ritual-stage {
  display: none;
  text-align: center;
  animation: ritualFade 0.6s ease;
}
.ritual-stage.active { display: block; }
.ritual-symbol {
  font-size: 40px;
  color: var(--gold);
  margin-bottom: 18px;
  animation: symbolPulse 1.6s ease-in-out infinite;
}
.ritual-text {
  font-size: 20px;
  color: var(--gold-light);
  letter-spacing: 8px;
  margin-bottom: 12px;
  animation: breathe 1.6s ease-in-out infinite;
}
.ritual-sub {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 2px;
  line-height: 1.8;
}
.ritual-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-top: 18px;
}
.ritual-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-dim);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.ritual-dots span:nth-child(2) { animation-delay: 0.2s; }
.ritual-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes symbolPulse {
  0%, 100% { opacity: 0.7; transform: scale(0.95); text-shadow: 0 0 12px rgba(212,168,67,0.4); }
  50% { opacity: 1; transform: scale(1.1); text-shadow: 0 0 26px rgba(212,168,67,0.75); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}
@keyframes dotPulse {
  0%, 100% { background: var(--gold-dim); transform: scale(0.8); opacity: 0.5; }
  50% { background: var(--gold); transform: scale(1.3); opacity: 1; }
}
@keyframes ritualFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 洗牌动画 */
.shuffle-deck {
  position: relative;
  width: 116px;
  height: 192px;
  margin: 0 auto 26px;
}
.shuffle-card {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 2px solid var(--gold);
  background:
    radial-gradient(circle at 50% 45%, rgba(212,168,67,0.28), transparent 62%),
    linear-gradient(135deg, #1a1a3e, #0d0d2b);
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}
.shuffle-card::before {
  content: '✦';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 34px;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(212,168,67,0.6);
}
.shuffle-card:nth-child(1) { animation: shf1 1.4s ease-in-out infinite; }
.shuffle-card:nth-child(2) { animation: shf2 1.4s ease-in-out infinite; animation-delay: 0.15s; }
.shuffle-card:nth-child(3) { animation: shf3 1.4s ease-in-out infinite; animation-delay: 0.3s; }
.shuffle-card:nth-child(4) { animation: shf4 1.4s ease-in-out infinite; animation-delay: 0.45s; }
@keyframes shf1 {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  50% { transform: translate(-22px,-12px) rotate(-10deg); }
}
@keyframes shf2 {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  50% { transform: translate(18px,-8px) rotate(8deg); }
}
@keyframes shf3 {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  50% { transform: translate(-14px,14px) rotate(-6deg); }
}
@keyframes shf4 {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  50% { transform: translate(16px,10px) rotate(7deg); }
}

/* 结果区 */
.taluo-result { display: none; }
.taluo-result.show { display: block; }

/* 整体解读 */
.taluo-summary {
  background: rgba(212,168,67,0.06);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 26px;
  color: #c0b090;
  font-size: 14px;
  line-height: 2;
  letter-spacing: 0.5px;
  white-space: pre-line;
}
.taluo-summary strong { color: var(--gold-light); }

/* 牌阵布局区 */
.taluo-board {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 34px 20px;
  margin-bottom: 26px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}
.board-relationship {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 22px 28px;
  justify-content: center;
}
.board-celtic {
  display: grid;
  grid-template-columns: repeat(6, auto);
  grid-template-rows: repeat(3, auto);
  gap: 14px;
  justify-content: center;
}
.board-celtic > :nth-child(1) { grid-row: 2; grid-column: 2; }
.board-celtic > :nth-child(2) { grid-row: 2; grid-column: 3; }
.board-celtic > :nth-child(3) { grid-row: 3; grid-column: 2; }
.board-celtic > :nth-child(4) { grid-row: 2; grid-column: 1; }
.board-celtic > :nth-child(5) { grid-row: 1; grid-column: 2; }
.board-celtic > :nth-child(6) { grid-row: 2; grid-column: 4; }
.board-celtic > :nth-child(7) { grid-row: 3; grid-column: 5; }
.board-celtic > :nth-child(8) { grid-row: 2; grid-column: 5; }
.board-celtic > :nth-child(9) { grid-row: 1; grid-column: 5; }
.board-celtic > :nth-child(10) { grid-row: 2; grid-column: 6; }

/* 牌包裹（牌 + 位置标签） */
.tarot-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tarot-pos-label {
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 2px;
  text-align: center;
  min-height: 18px;
}

/* 牌 */
.tarot-card {
  position: relative;
  width: 116px;
  height: 198px;
  perspective: 1000px;
  flex-shrink: 0;
}
.tarot-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.tarot-card.flipped .tarot-card-inner {
  transform: rotateY(180deg);
}
.tarot-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 牌背 */
.tarot-back {
  background:
    radial-gradient(circle at 50% 45%, rgba(212,168,67,0.28), transparent 62%),
    linear-gradient(135deg, #1a1a3e, #0d0d2b);
  border: 2px solid var(--gold);
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}
.tarot-back::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212,168,67,0.4);
  border-radius: 6px;
}
.tarot-back::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(212,168,67,0.2);
  border-radius: 4px;
}
.tarot-back-symbol {
  font-size: 38px;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(212,168,67,0.65);
  z-index: 1;
  line-height: 1;
}

/* 牌面 */
.tarot-front {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, rgba(30,30,60,0.96), rgba(20,20,45,0.96));
  border: 2px solid var(--gold);
  padding: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}
.tarot-front::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(212,168,67,0.35);
  border-radius: 6px;
  pointer-events: none;
  z-index: 2;
}
/* 牌面图（占满牌面，图片含全部信息：插画 + 编号 + 牌名等） */
.tc-art-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.tc-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tc-art-fallback {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tc-art-wrap.no-art .tc-art { display: none; }
.tc-art-wrap.no-art .tc-art-fallback { display: flex; }
/* fallback 文字（仅图片未生成时显示） */
.tc-fb-symbol {
  font-size: 42px;
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(212,168,67,0.4);
  margin-bottom: 6px;
}
.tc-fb-name {
  font-size: 14px;
  color: var(--gold-light);
  letter-spacing: 2px;
  font-weight: bold;
}
.tc-fb-nameen {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}
.tc-fb-element {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 2px;
}

/* 逆位：牌面正面展示不旋转，仅以右上角「逆位」角标区分 */
.tarot-card.reversed.flipped .tarot-card-inner {
  transform: rotateY(180deg);
}
/* 逆位角标（置于 tarot-card 内，不随牌面旋转，始终正向） */
.tc-rev-mark {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  color: var(--bg-1);
  background: var(--bad);
  padding: 1px 5px;
  border-radius: 8px;
  letter-spacing: 1px;
  z-index: 3;
  display: none;
}
.tarot-card.reversed.flipped .tc-rev-mark {
  display: block;
}

/* 解读列表 */
.taluo-interpretations {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px 26px;
  margin-bottom: 24px;
}
.taluo-interp-title {
  color: var(--gold);
  font-size: 15px;
  letter-spacing: 4px;
  border-left: 3px solid var(--gold);
  padding-left: 10px;
  margin-bottom: 16px;
}
.interp-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(90,90,124,0.2);
}
.interp-item:last-child { border-bottom: none; }
.interp-card-mini {
  flex-shrink: 0;
  width: 58px;
  text-align: center;
}
.icm-symbol {
  width: 52px; height: 52px;
  border: 1.5px solid var(--gold);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--gold-light);
  background: rgba(212,168,67,0.06);
  margin-bottom: 4px;
}
.interp-card-mini.reversed .icm-symbol {
  transform: rotate(180deg);
}
.icm-name {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1px;
}
.interp-detail-link {
  display: inline-block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1px;
  transition: color 0.2s;
}
.interp-detail-link:hover { color: var(--gold-light); }
.interp-body { flex: 1; min-width: 0; }
.interp-pos {
  font-size: 13px;
  color: var(--gold-light);
  letter-spacing: 2px;
  font-weight: bold;
  margin-bottom: 2px;
}
.interp-orient {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: normal;
  margin-left: 6px;
}
.interp-orient.rev { color: var(--bad); }
.interp-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.interp-text {
  font-size: 13px;
  color: #c0b090;
  line-height: 1.8;
  letter-spacing: 0.3px;
}
.interp-advice {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(212,168,67,0.06);
  border-left: 2px solid var(--gold-dim);
  border-radius: 4px;
  font-size: 13px;
  color: #c0b090;
  line-height: 1.8;
  letter-spacing: 0.3px;
}
.interp-advice strong { color: var(--gold-light); }
.interp-keywords {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.interp-keywords span {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(90,90,124,0.15);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 1px;
}

/* 重新占卜 */
.taluo-redraw { text-align: center; }
.taluo-redraw-btn {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 12px 40px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 4px;
  font-family: inherit;
  transition: all 0.25s;
}
.taluo-redraw-btn:hover {
  color: var(--bg-1);
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border-color: var(--gold);
}

/* 响应式 */
@media (max-width: 768px) {
  .spread-grid { grid-template-columns: repeat(2, 1fr); }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .taluo-setup { padding: 20px 16px; }
  .tarot-card { width: 92px; height: 155px; }
  .tc-symbol { font-size: 32px; }
  .tc-name { font-size: 12px; }
  .tc-nameen { font-size: 8px; }
  .tarot-back-symbol { font-size: 30px; }
  .board-celtic { gap: 8px; overflow-x: auto; justify-content: flex-start; padding: 30px 12px; }
  .board-celtic .tarot-card { width: 70px; height: 116px; }
  .board-celtic .tc-symbol { font-size: 24px; }
  .board-celtic .tc-name { font-size: 10px; }
  .board-celtic .tc-nameen, .board-celtic .tc-element { font-size: 8px; }
  .board-celtic .tc-number { font-size: 10px; }
  .board-relationship { gap: 14px 18px; }
  .interp-item { flex-direction: column; gap: 8px; }
  .interp-card-mini { display: flex; align-items: center; gap: 10px; width: auto; }
  .interp-card-mini .icm-symbol { width: 40px; height: 40px; font-size: 18px; margin-bottom: 0; }
  .taluo-interpretations { padding: 18px 16px; }
}

/* ========== 明亮主题适配 ========== */
[data-theme="light"] .taluo-setup,
[data-theme="light"] .taluo-board,
[data-theme="light"] .taluo-interpretations {
  background: linear-gradient(180deg, rgba(255,253,247,0.98), rgba(248,243,230,0.92));
  border-color: #c4b59a;
}
[data-theme="light"] .spread-option,
[data-theme="light"] .theme-option {
  background: rgba(255,253,247,0.7);
  border-color: #c4b59a;
}
[data-theme="light"] .spread-option.active {
  background: linear-gradient(180deg, rgba(138,104,16,0.15), rgba(138,104,16,0.05));
}
[data-theme="light"] .taluo-question {
  background: rgba(255,253,247,0.9);
  border-color: var(--gold-dim);
  color: var(--text);
}
[data-theme="light"] .taluo-summary {
  background: rgba(138,104,16,0.08);
  color: #3a3225;
}
[data-theme="light"] .tarot-back,
[data-theme="light"] .shuffle-card {
  background:
    radial-gradient(circle at 50% 45%, rgba(138,104,16,0.25), transparent 62%),
    linear-gradient(135deg, #f0e8d6, #e6dcc4);
}
[data-theme="light"] .tarot-front {
  background: linear-gradient(180deg, rgba(255,253,247,0.98), rgba(248,243,230,0.95));
}
[data-theme="light"] .interp-text {
  color: #3a3225;
}
[data-theme="light"] .interp-advice {
  background: rgba(138,104,16,0.08);
  color: #3a3225;
}
[data-theme="light"] .interp-item {
  border-bottom-color: rgba(180,160,120,0.35);
}
[data-theme="light"] .interp-keywords span {
  background: rgba(160,140,100,0.18);
}
[data-theme="light"] .icm-symbol {
  background: rgba(138,104,16,0.08);
}
