/* ==================== 全局重置 & 基础 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: #0a0015;
  color: #e8d5b7;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ==================== 星空背景 ==================== */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(60, 0, 80, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(80, 0, 100, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(20, 0, 40, 0.5) 0%, transparent 70%);
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--duration) ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: var(--min-opacity, 0.3); transform: scale(1); }
  50% { opacity: var(--max-opacity, 1); transform: scale(1.3); }
}

/* ==================== 流星群 ==================== */
.shooting-star {
  position: fixed;
  z-index: 1;
  pointer-events: none;
}

/* 所有流星共用的头部光晕 */
.shooting-star::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.3) 30%, transparent 70%);
  opacity: 0;
  animation: glowPulse var(--speed) ease-out infinite;
}

@keyframes glowPulse {
  0%, 85%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  2.5% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.2); }
  6% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.8); }
}

/* ===== 白色流星 ===== */
.shooting-star.white {
  width: 2.5px;
  height: 2.5px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 10px 4px rgba(255, 255, 255, 0.5);
  animation: shootArc var(--speed) cubic-bezier(0.0, 0.0, 0.2, 1) infinite;
}

/* 白流星 - 主拖尾（渐变长尾） */
.shooting-star.white::after {
  content: '';
  position: absolute;
  top: -0.75px;
  right: 2.5px;
  width: 180px;
  height: 4px;
  background: linear-gradient(to left,
    rgba(255,255,255,0.8) 0%,
    rgba(255,255,255,0.5) 8%,
    rgba(255,255,255,0.25) 20%,
    rgba(255,255,255,0.1) 35%,
    rgba(255,255,255,0.03) 55%,
    transparent 80%
  );
  border-radius: 2px 0 0 2px;
  transform-origin: right center;
  animation: tailFade var(--speed) ease-out infinite;
  filter: blur(0.5px);
}

/* 白流星 - 外层光晕拖尾（使用 box-shadow 多层） */
.shooting-star.white {
  filter: drop-shadow(0 0 0 transparent);
  animation: shootArc var(--speed) cubic-bezier(0.0, 0.0, 0.2, 1) infinite,
             tailGlowWhite var(--speed) ease-out infinite;
}

@keyframes tailGlowWhite {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  2% { filter: drop-shadow(-10px 5px 8px rgba(255,255,255,0.3)) drop-shadow(-30px 15px 15px rgba(255,255,255,0.15)) drop-shadow(-60px 30px 25px rgba(255,255,255,0.05)); }
  7% { filter: drop-shadow(-10px 5px 8px rgba(255,255,255,0.3)) drop-shadow(-30px 15px 15px rgba(255,255,255,0.15)) drop-shadow(-60px 30px 25px rgba(255,255,255,0.05)); }
  12% { filter: drop-shadow(-10px 5px 8px rgba(255,255,255,0.1)) drop-shadow(-30px 15px 15px rgba(255,255,255,0.05)) drop-shadow(-60px 30px 25px rgba(255,255,255,0.02)); }
  100% { filter: drop-shadow(0 0 0 transparent); }
}

/* ===== 金色流星 ===== */
.shooting-star.golden {
  width: 3px;
  height: 3px;
  background: #f7e8a0;
  border-radius: 50%;
  box-shadow: 0 0 14px 5px rgba(212, 168, 67, 0.5);
  animation: shootArc var(--speed) cubic-bezier(0.0, 0.0, 0.2, 1) infinite,
             tailGlowGolden var(--speed) ease-out infinite;
}

/* 金流星 - 主拖尾（渐变长尾） */
.shooting-star.golden::after {
  content: '';
  position: absolute;
  top: -1px;
  right: 3px;
  width: 220px;
  height: 5px;
  background: linear-gradient(to left,
    rgba(247,232,160,0.9) 0%,
    rgba(247,232,160,0.5) 10%,
    rgba(247,232,160,0.25) 22%,
    rgba(247,232,160,0.1) 38%,
    rgba(247,232,160,0.03) 55%,
    transparent 80%
  );
  border-radius: 2.5px 0 0 2.5px;
  transform-origin: right center;
  animation: tailFade var(--speed) ease-out infinite;
  filter: blur(0.5px);
}

@keyframes tailGlowGolden {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  2% { filter: drop-shadow(-12px 6px 10px rgba(212,168,67,0.35)) drop-shadow(-35px 18px 20px rgba(212,168,67,0.15)) drop-shadow(-70px 35px 30px rgba(212,168,67,0.05)); }
  7% { filter: drop-shadow(-12px 6px 10px rgba(212,168,67,0.35)) drop-shadow(-35px 18px 20px rgba(212,168,67,0.15)) drop-shadow(-70px 35px 30px rgba(212,168,67,0.05)); }
  12% { filter: drop-shadow(-12px 6px 10px rgba(212,168,67,0.1)) drop-shadow(-35px 18px 20px rgba(212,168,67,0.05)) drop-shadow(-70px 35px 30px rgba(212,168,67,0.02)); }
  100% { filter: drop-shadow(0 0 0 transparent); }
}

/* ===== 紫色流星 ===== */
.shooting-star.purple {
  width: 2.5px;
  height: 2.5px;
  background: #c084fc;
  border-radius: 50%;
  box-shadow: 0 0 12px 4px rgba(192, 132, 252, 0.4);
  animation: shootArc var(--speed) cubic-bezier(0.0, 0.0, 0.2, 1) infinite,
             tailGlowPurple var(--speed) ease-out infinite;
}

/* 紫流星 - 主拖尾（渐变长尾） */
.shooting-star.purple::after {
  content: '';
  position: absolute;
  top: -0.75px;
  right: 2.5px;
  width: 150px;
  height: 4px;
  background: linear-gradient(to left,
    rgba(192,132,252,0.8) 0%,
    rgba(192,132,252,0.45) 8%,
    rgba(192,132,252,0.2) 20%,
    rgba(192,132,252,0.08) 35%,
    rgba(192,132,252,0.03) 50%,
    transparent 75%
  );
  border-radius: 2px 0 0 2px;
  transform-origin: right center;
  animation: tailFade var(--speed) ease-out infinite;
  filter: blur(0.5px);
}

@keyframes tailGlowPurple {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  2% { filter: drop-shadow(-10px 5px 8px rgba(192,132,252,0.3)) drop-shadow(-25px 12px 15px rgba(192,132,252,0.12)) drop-shadow(-50px 25px 25px rgba(192,132,252,0.04)); }
  7% { filter: drop-shadow(-10px 5px 8px rgba(192,132,252,0.3)) drop-shadow(-25px 12px 15px rgba(192,132,252,0.12)) drop-shadow(-50px 25px 25px rgba(192,132,252,0.04)); }
  12% { filter: drop-shadow(-10px 5px 8px rgba(192,132,252,0.1)) drop-shadow(-25px 12px 15px rgba(192,132,252,0.04)) drop-shadow(-50px 25px 25px rgba(192,132,252,0.01)); }
  100% { filter: drop-shadow(0 0 0 transparent); }
}

/* 拖尾显隐同步 */
@keyframes tailFade {
  0%, 100% { opacity: 0; }
  2% { opacity: 1; }
  10% { opacity: 0.5; }
  15% { opacity: 0; }
}

/* 不同流星的起始位置和延迟（分布更广，节奏更分散） */
.shooting-star:nth-child(1) { top: 8%; left: 82%; --speed: 6s; animation-delay: 0s; }
.shooting-star:nth-child(2) { top: 30%; left: 70%; --speed: 7s; animation-delay: 2.3s; }
.shooting-star:nth-child(3) { top: 22%; left: 20%; --speed: 5.5s; animation-delay: 1.2s; }
.shooting-star:nth-child(4) { top: 55%; left: 65%; --speed: 8s; animation-delay: 4s; }
.shooting-star:nth-child(5) { top: 60%; left: 25%; --speed: 6.5s; animation-delay: 3s; }
.shooting-star:nth-child(6) { top: 75%; left: 75%; --speed: 7.5s; animation-delay: 5s; }
.shooting-star:nth-child(7) { top: 15%; left: 45%; --speed: 9s; animation-delay: 6s; }
.shooting-star:nth-child(8) { top: 82%; left: 45%; --speed: 6s; animation-delay: 4.5s; }
.shooting-star:nth-child(9) { top: 42%; left: 85%; --speed: 7s; animation-delay: 7s; }
.shooting-star:nth-child(10) { top: 68%; left: 12%; --speed: 8.5s; animation-delay: 5.5s; }

/* 主流星运动——弧形抛物线，带加速和减速 */
@keyframes shootArc {
  0% {
    transform: translate(0px, 0px) rotate(-18deg);
    opacity: 0;
  }
  1.5% {
    opacity: 0.2;
  }
  3% {
    opacity: 1;
    transform: translate(-30px, 15px) rotate(-19deg);
  }
  6% {
    transform: translate(-100px, 60px) rotate(-21deg);
  }
  10% {
    transform: translate(-200px, 130px) rotate(-23deg);
    opacity: 0.8;
  }
  14% {
    transform: translate(-280px, 195px) rotate(-25deg);
    opacity: 0;
  }
  100% {
    transform: translate(-350px, 260px) rotate(-25deg);
    opacity: 0;
  }
}

/* 对角线飞行的流星群（另一种方向） */
.shooting-star.diagonal {
  animation: shootArcDiagonal var(--speed) cubic-bezier(0.0, 0.0, 0.2, 1) infinite,
             tailGlowDiagonal var(--speed) ease-out infinite;
}

.shooting-star.diagonal::after {
  right: auto;
  left: 2.5px;
  transform-origin: left center;
  background: linear-gradient(to right,
    rgba(255,255,255,0.8) 0%,
    rgba(255,255,255,0.5) 8%,
    rgba(255,255,255,0.25) 20%,
    rgba(255,255,255,0.1) 35%,
    rgba(255,255,255,0.03) 55%,
    transparent 80%
  );
  border-radius: 0 2px 2px 0;
}

@keyframes tailGlowDiagonal {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  2% { filter: drop-shadow(10px 5px 8px rgba(255,255,255,0.3)) drop-shadow(30px 15px 15px rgba(255,255,255,0.15)) drop-shadow(60px 30px 25px rgba(255,255,255,0.05)); }
  7% { filter: drop-shadow(10px 5px 8px rgba(255,255,255,0.3)) drop-shadow(30px 15px 15px rgba(255,255,255,0.15)) drop-shadow(60px 30px 25px rgba(255,255,255,0.05)); }
  12% { filter: drop-shadow(10px 5px 8px rgba(255,255,255,0.1)) drop-shadow(30px 15px 15px rgba(255,255,255,0.05)) drop-shadow(60px 30px 25px rgba(255,255,255,0.02)); }
  100% { filter: drop-shadow(0 0 0 transparent); }
}

@keyframes shootArcDiagonal {
  0% {
    transform: translate(0px, 0px) rotate(18deg);
    opacity: 0;
  }
  1.5% {
    opacity: 0.2;
  }
  3% {
    opacity: 1;
    transform: translate(30px, 15px) rotate(19deg);
  }
  6% {
    transform: translate(100px, 60px) rotate(21deg);
  }
  10% {
    transform: translate(200px, 130px) rotate(23deg);
    opacity: 0.8;
  }
  14% {
    transform: translate(280px, 195px) rotate(25deg);
    opacity: 0;
  }
  100% {
    transform: translate(350px, 260px) rotate(25deg);
    opacity: 0;
  }
}

/* ==================== 浮动作者名 ==================== */
.author-float {
  position: fixed;
  font-size: 1.2em;
  font-weight: bold;
  letter-spacing: 6px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.25;
  font-family: 'Georgia', 'STKaiti', 'KaiTi', serif;
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.6), rgba(247, 232, 160, 0.8), rgba(212, 168, 67, 0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.2));
  animation: floatAround 24s ease-in-out infinite;
  white-space: nowrap;
  user-select: none;
}

@keyframes floatAround {
  0% {
    top: 3%;
    left: 3%;
    transform: rotate(-3deg) scale(1);
    opacity: 0.15;
  }
  12% {
    top: 8%;
    left: 78%;
    transform: rotate(4deg) scale(1.1);
    opacity: 0.3;
  }
  25% {
    top: 85%;
    left: 72%;
    transform: rotate(-2deg) scale(0.95);
    opacity: 0.2;
  }
  37% {
    top: 12%;
    left: 10%;
    transform: rotate(5deg) scale(1.05);
    opacity: 0.28;
  }
  50% {
    top: 90%;
    left: 15%;
    transform: rotate(-4deg) scale(1.08);
    opacity: 0.22;
  }
  62% {
    top: 5%;
    left: 45%;
    transform: rotate(3deg) scale(0.9);
    opacity: 0.18;
  }
  75% {
    top: 88%;
    left: 50%;
    transform: rotate(-5deg) scale(1.02);
    opacity: 0.26;
  }
  87% {
    top: 15%;
    left: 85%;
    transform: rotate(2deg) scale(1.12);
    opacity: 0.2;
  }
  100% {
    top: 3%;
    left: 3%;
    transform: rotate(-3deg) scale(1);
    opacity: 0.15;
  }
}

/* ==================== 容器 & 布局 ==================== */
.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
}

/* ==================== 标题区 ==================== */
header {
  text-align: center;
  margin-bottom: 50px;
  padding-top: 20px;
}

.title {
  font-size: 3em;
  background: linear-gradient(135deg, #d4a843, #f7e8a0, #d4a843);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  letter-spacing: 6px;
  margin-bottom: 10px;
  position: relative;
  display: inline-block;
  animation: titleGlow 3s ease-in-out infinite, titleSparkle 4s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(212, 168, 67, 0.3)) drop-shadow(0 0 30px rgba(212, 168, 67, 0.1)); }
  50% { filter: drop-shadow(0 0 25px rgba(212, 168, 67, 0.6)) drop-shadow(0 0 50px rgba(212, 168, 67, 0.2)); }
}

/* 星语者 布灵布灵闪闪发光效果 */
.title::before {
  content: '✦ 星 语 者 ✦';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    transparent 0%,
    transparent 20%,
    rgba(255, 255, 255, 0.8) 25%,
    transparent 30%,
    transparent 50%,
    rgba(255, 255, 255, 0.6) 55%,
    transparent 60%,
    transparent 80%,
    rgba(255, 255, 255, 0.9) 85%,
    transparent 90%,
    transparent 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  25% {
    background-position: -100% 0;
    opacity: 0.6;
  }
  35% {
    opacity: 0;
  }
  100% {
    background-position: -100% 0;
    opacity: 0;
  }
}

/* 闪烁小星星装饰 */
.title::after {
  content: '';
  position: absolute;
  top: -15px;
  right: -20px;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.3) 30%, transparent 70%);
  border-radius: 50%;
  box-shadow: 
    0 0 15px 5px rgba(255, 255, 255, 0.4),
    0 0 30px 10px rgba(212, 168, 67, 0.2);
  animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { 
    transform: scale(0.5) rotate(0deg);
    opacity: 0.3;
    box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.3);
  }
  25% {
    transform: scale(1.5) rotate(180deg);
    opacity: 1;
    box-shadow: 0 0 25px 8px rgba(255, 255, 255, 0.6), 0 0 50px 15px rgba(212, 168, 67, 0.3);
  }
  50% {
    transform: scale(0.8) rotate(360deg);
    opacity: 0.6;
    box-shadow: 0 0 15px 5px rgba(255, 255, 255, 0.4);
  }
  75% {
    transform: scale(1.2) rotate(540deg);
    opacity: 0.9;
    box-shadow: 0 0 20px 6px rgba(255, 255, 255, 0.5), 0 0 40px 12px rgba(212, 168, 67, 0.25);
  }
  100% { 
    transform: scale(0.5) rotate(720deg);
    opacity: 0.3;
    box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.3);
  }
}

/* 标题装饰小星星（3个额外闪烁点） */
.sparkle-dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.2) 40%, transparent 70%);
  animation: sparkleDot 2s ease-in-out infinite;
}

.sparkle-1 {
  width: 8px;
  height: 8px;
  top: -20px;
  left: -25px;
  box-shadow: 0 0 12px 4px rgba(255, 255, 255, 0.5), 0 0 25px 8px rgba(212, 168, 67, 0.3);
  animation-delay: 0s;
}

.sparkle-2 {
  width: 6px;
  height: 6px;
  top: -10px;
  right: -30px;
  box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.4), 0 0 20px 6px rgba(212, 168, 67, 0.25);
  animation-delay: 0.7s;
}

.sparkle-3 {
  width: 5px;
  height: 5px;
  bottom: -8px;
  left: 50%;
  margin-left: -2.5px;
  box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.4), 0 0 15px 5px rgba(212, 168, 67, 0.2);
  animation-delay: 1.4s;
}

@keyframes sparkleDot {
  0%, 100% { 
    transform: scale(0.3) rotate(0deg);
    opacity: 0.2;
  }
  25% {
    transform: scale(1.8) rotate(180deg);
    opacity: 1;
  }
  50% {
    transform: scale(0.6) rotate(360deg);
    opacity: 0.5;
  }
  75% {
    transform: scale(1.2) rotate(540deg);
    opacity: 0.8;
  }
  100% { 
    transform: scale(0.3) rotate(720deg);
    opacity: 0.2;
  }
}

/* 定义 titleSparkle 动画 */
@keyframes titleSparkle {
  0%, 100% { filter: brightness(1); }
  25% { filter: brightness(1.3); }
  50% { filter: brightness(1); }
  75% { filter: brightness(1.2); }
}

.subtitle {
  font-size: 1.1em;
  color: #a07858;
  letter-spacing: 8px;
  font-style: italic;
}

.divider {
  width: 200px;
  height: 2px;
  background: linear-gradient(to right, transparent, #d4a843, transparent);
  margin: 20px auto;
}

/* ==================== 输入区 ==================== */
.input-section {
  background: linear-gradient(135deg, rgba(30, 0, 50, 0.8), rgba(20, 0, 40, 0.8));
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 40px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(212, 168, 67, 0.1);
}

.input-section label {
  display: block;
  font-size: 0.95em;
  color: #c4a06a;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.question-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 10px;
  color: #e8d5b7;
  font-size: 1.05em;
  font-family: inherit;
  transition: all 0.3s ease;
  resize: vertical;
  min-height: 80px;
}

.question-input:focus {
  outline: none;
  border-color: #d4a843;
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.15);
  background: rgba(0, 0, 0, 0.6);
}

.question-input::placeholder {
  color: rgba(168, 120, 88, 0.5);
}

.btn-divine {
  display: block;
  width: 100%;
  padding: 16px;
  margin-top: 20px;
  background: linear-gradient(135deg, #8b6914, #d4a843, #8b6914);
  border: none;
  border-radius: 10px;
  color: #0a0015;
  font-size: 1.15em;
  font-weight: bold;
  letter-spacing: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-divine:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 168, 67, 0.3);
}

.btn-divine:active:not(:disabled) {
  transform: translateY(0);
}

.btn-divine:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-divine::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #d4a843, transparent, #d4a843, transparent);
  background-size: 400% 400%;
  border-radius: 12px;
  z-index: -1;
  animation: btnGlow 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-divine:hover:not(:disabled)::before {
  opacity: 1;
}

@keyframes btnGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.btn-divine .btn-icon {
  margin-right: 8px;
}

/* ==================== 牌区 ==================== */
.cards-section {
  margin-bottom: 40px;
  min-height: 350px;
}

.cards-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  perspective: 1200px;
}

.card-wrapper {
  width: 200px;
  height: 320px;
  perspective: 800px;
  cursor: pointer;
  position: relative;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 1s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-style: preserve-3d;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border-radius: 12px;
}

.card-wrapper.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

/* 牌背 */
.card-back {
  background: linear-gradient(135deg, #1a0030, #2d0050, #1a0030);
  border: 2px solid #d4a843;
  box-shadow: inset 0 0 30px rgba(212, 168, 67, 0.1);
  overflow: hidden;
}

.card-back::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 8px;
  background: 
    radial-gradient(circle at 50% 50%, transparent 30%, rgba(212, 168, 67, 0.05) 60%, transparent 70%);
}

.card-back-pattern {
  font-size: 3em;
  color: #d4a843;
  text-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
  z-index: 1;
}

.card-back-text {
  color: rgba(212, 168, 67, 0.6);
  font-size: 0.8em;
  margin-top: 8px;
  letter-spacing: 3px;
  z-index: 1;
}

/* 牌面 */
.card-front {
  background: linear-gradient(135deg, #f5e6d0, #e8d5b7, #f5e6d0);
  border: 2px solid #d4a843;
  transform: rotateY(180deg);
  color: #2a0010;
  overflow: hidden;
}

.card-front::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: 8px;
  pointer-events: none;
}

.card-symbol {
  font-size: 3.5em;
  margin-bottom: 8px;
}

.card-name {
  font-size: 1.3em;
  font-weight: bold;
  color: #1a0030;
  margin-bottom: 4px;
}

.card-name-en {
  font-size: 0.75em;
  color: #8b7355;
  font-style: italic;
  margin-bottom: 6px;
}

.card-status {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75em;
  letter-spacing: 1px;
  margin-top: 4px;
}

.card-status.upright {
  background: linear-gradient(135deg, #2d7d46, #3a9d5a);
  color: white;
}

.card-status.reversed {
  background: linear-gradient(135deg, #8b2d2d, #b83a3a);
  color: white;
}

.card-meaning {
  font-size: 0.75em;
  color: #5a4030;
  margin-top: 8px;
  line-height: 1.4;
  padding: 0 5px;
}

.card-number {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 0.7em;
  color: rgba(42, 0, 16, 0.3);
  font-weight: bold;
}

/* 翻牌前悬停效果 */
.card-wrapper:not(.flipped):hover .card-inner {
  transform: rotateY(15deg);
  box-shadow: 0 8px 30px rgba(212, 168, 67, 0.2);
}

/* ==================== 加载动画 ==================== */
.loading-section {
  text-align: center;
  padding: 40px 20px;
  display: none;
}

.loading-section.active {
  display: block;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 3px solid rgba(212, 168, 67, 0.2);
  border-top: 3px solid #d4a843;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: #d4a843;
  font-size: 1.1em;
  letter-spacing: 3px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ==================== 解读区 ==================== */
.reading-section {
  background: linear-gradient(135deg, rgba(30, 0, 50, 0.9), rgba(15, 0, 30, 0.9));
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 16px;
  padding: 35px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: none;
  position: relative;
  overflow: hidden;
}

.reading-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, #d4a843, transparent);
}

.reading-section.active {
  display: block;
  animation: fadeInUp 0.6s ease;
}

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

.reading-header {
  text-align: center;
  margin-bottom: 25px;
}

.reading-header h2 {
  font-size: 1.5em;
  color: #d4a843;
  letter-spacing: 4px;
}

.reading-header .question-review {
  color: #a07858;
  font-style: italic;
  margin-top: 8px;
  font-size: 0.95em;
}

.reading-content {
  line-height: 1.9;
  color: #e0d0b8;
  font-size: 1.05em;
  white-space: pre-wrap;
}

.reading-content .typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: #d4a843;
  animation: blink 0.8s step-end infinite;
  margin-left: 2px;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

.btn-reset {
  display: block;
  margin: 30px auto 0;
  padding: 14px 40px;
  background: transparent;
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: 10px;
  color: #d4a843;
  font-size: 1em;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-reset:hover {
  background: rgba(212, 168, 67, 0.1);
  border-color: #d4a843;
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.15);
}

/* ==================== 错误提示 ==================== */
.error-message {
  background: rgba(180, 40, 40, 0.2);
  border: 1px solid rgba(180, 40, 40, 0.4);
  border-radius: 10px;
  padding: 15px 20px;
  color: #e06060;
  text-align: center;
  margin-bottom: 20px;
  display: none;
}

.error-message.active {
  display: block;
  animation: fadeInUp 0.3s ease;
}

/* ==================== 页脚 ==================== */
footer {
  text-align: center;
  padding: 30px 0;
  color: rgba(168, 120, 88, 0.4);
  font-size: 0.85em;
  letter-spacing: 2px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
  .container {
    padding: 20px 15px;
  }

  .title {
    font-size: 2em;
    letter-spacing: 4px;
  }

  .subtitle {
    font-size: 0.9em;
    letter-spacing: 5px;
  }

  .cards-container {
    gap: 15px;
  }

  .card-wrapper {
    width: 150px;
    height: 250px;
  }

  .card-symbol {
    font-size: 2.5em;
  }

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

  .card-name-en {
    font-size: 0.65em;
  }

  .card-meaning {
    font-size: 0.65em;
  }

  .input-section {
    padding: 20px;
  }

  .reading-section {
    padding: 25px;
  }

  .btn-divine {
    font-size: 1em;
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .card-wrapper {
    width: 120px;
    height: 200px;
  }

  .card-symbol {
    font-size: 2em;
  }

  .card-name {
    font-size: 0.95em;
  }

  .card-front {
    padding: 12px;
  }

  .card-back {
    padding: 12px;
  }
}
