@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-gold: #d4af37;
  --primary-amber: #ffb347;
  --dark-bg: #0a0e27;
  --card-bg: rgba(20, 25, 45, 0.8);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --text-primary: #ffffff;
  --text-secondary: #b8c5d6;
  --shadow-glow: 0 0 30px rgba(212, 175, 55, 0.3);
}

body {
  font-family: 'Noto Serif SC', serif;
  background:
    linear-gradient(135deg, rgba(10, 14, 39, 0.85) 0%, rgba(26, 31, 58, 0.85) 50%, rgba(15, 20, 40, 0.85) 100%),
    url('bg.png') center/cover no-repeat fixed;
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 179, 71, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeInDown 0.8s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
}

.header-logo {
  width: 100px !important;
  height: 100px !important;
  max-width: 100px !important;
  max-height: 100px !important;
  min-width: 100px !important;
  min-height: 100px !important;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.4));
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}

/* 额外的图片控制 */
header img {
  width: 100px !important;
  height: 100px !important;
  max-width: 100px !important;
  max-height: 100px !important;
}

.header-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0;
  text-shadow: 0 0 40px rgba(212, 175, 55, 0.5);
  letter-spacing: 8px;
  line-height: 1;
}

.title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 3px;
  margin-top: 0;
  line-height: 1;
}

.intro-section {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 40px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: var(--shadow-glow);
  animation: fadeIn 1s ease-out 0.2s both;
}

.intro-section h2 {
  color: var(--primary-gold);
  margin-bottom: 20px;
  font-size: 1.5rem;
  text-align: center;
}

.intro-section p {
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 15px;
  text-indent: 2em;
}

.divination-area {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 40px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: var(--shadow-glow);
  animation: fadeIn 1s ease-out 0.4s both;
}

.progress-indicator {
  text-align: center;
  margin-bottom: 30px;
}

.progress-text {
  font-size: 1.2rem;
  color: var(--primary-amber);
  margin-bottom: 15px;
  font-weight: 600;
}

.yao-lines {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.yao-line {
  width: 60px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.yao-line.filled {
  background: linear-gradient(90deg, var(--primary-gold), var(--primary-amber));
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
  animation: glow 1.5s ease-in-out infinite;
}

.coin-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 40px 0;
  min-height: 120px;
  align-items: center;
}

.coin {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-gold) 0%, #c9a961 100%);
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3),
    inset 0 -5px 10px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: #2a1810;
  cursor: pointer;
  transition: transform 0.3s ease;
  position: relative;
}

.coin:hover {
  transform: scale(1.05);
}

.coin.flipping {
  animation: flip 0.6s ease-in-out;
}

.coin::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), transparent);
  pointer-events: none;
}

.action-button {
  display: block;
  margin: 0 auto;
  padding: 18px 60px;
  font-size: 1.3rem;
  font-weight: 600;
  color: #2a1810;
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-amber) 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 3px;
}

.action-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(212, 175, 55, 0.6);
}

.action-button:active {
  transform: translateY(-1px);
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.result-section {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: var(--shadow-glow);
  display: none;
  animation: fadeInUp 0.8s ease-out;
}

.result-section.show {
  display: block;
}

.hexagram-display {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}

/* 额外的微尘粒子 - 漩涡效果 */
.hexagram-display::before,
.hexagram-display::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hexagram-display::before {
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.9), transparent);
  top: 50%;
  left: 50%;
  animation: spiralParticle1 3s ease-out forwards;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
}

.hexagram-display::after {
  width: 3px;
  height: 3px;
  background: radial-gradient(circle, rgba(255, 179, 71, 0.9), transparent);
  top: 50%;
  left: 50%;
  animation: spiralParticle2 3.2s ease-out forwards;
  box-shadow: 0 0 6px rgba(255, 179, 71, 0.7);
}

.hexagram-symbol {
  font-size: 5rem;
  margin: 20px 0;
  letter-spacing: 10px;
  color: var(--primary-gold);
  text-shadow:
    0 0 20px rgba(212, 175, 55, 0.6),
    0 0 40px rgba(212, 175, 55, 0.4);
  position: relative;
  filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5));
}

/* 粒子1 - 漩涡 */
.hexagram-symbol::before {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.9), transparent);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  animation: spiralParticle3 2.8s ease-out forwards;
  pointer-events: none;
  box-shadow:
    0 0 10px rgba(212, 175, 55, 0.8),
    0 0 20px rgba(255, 179, 71, 0.4);
}

/* 粒子2 - 漩涡 */
.hexagram-symbol::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(255, 179, 71, 0.9), transparent);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  animation: spiralParticle4 3.1s ease-out forwards;
  pointer-events: none;
  box-shadow:
    0 0 8px rgba(255, 179, 71, 0.7),
    0 0 15px rgba(212, 175, 55, 0.3);
}

.hexagram-name {
  font-size: 2.5rem;
  color: var(--primary-amber);
  margin: 15px 0;
  font-weight: 700;
}

.hexagram-meaning {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.interpretation {
  background: rgba(255, 255, 255, 0.03);
  padding: 25px;
  border-radius: 15px;
  border-left: 4px solid var(--primary-gold);
  margin-top: 20px;
}

.interpretation h3 {
  color: var(--primary-gold);
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.interpretation p {
  line-height: 1.9;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.modern-interpretation {
  margin-top: 25px;
  border-left-color: var(--primary-gold);
}

.modern-interpretation h3 {
  color: var(--primary-gold);
}

.classical-text {
  font-style: italic;
  letter-spacing: 1px;
}

.modern-text {
  line-height: 2;
}

.reset-button {
  display: block;
  margin: 30px auto 0;
  padding: 12px 40px;
  font-size: 1.1rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--primary-gold);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 2px;
}

.reset-button:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: translateY(-2px);
}

footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes flip {

  0%,
  100% {
    transform: rotateY(0deg) rotateX(0deg);
  }

  25% {
    transform: rotateY(180deg) rotateX(20deg);
  }

  50% {
    transform: rotateY(360deg) rotateX(0deg);
  }

  75% {
    transform: rotateY(540deg) rotateX(-20deg);
  }
}

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
  }

  50% {
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.9);
  }
}

@keyframes particle1 {
  0% {
    transform: translate(0, 0) scale(0);
    opacity: 0;
  }

  20% {
    transform: translate(-15px, -20px) scale(1.2);
    opacity: 1;
  }

  60% {
    transform: translate(-8px, -10px) scale(1);
    opacity: 0.8;
  }

  100% {
    transform: translate(20px, 15px) scale(0.3);
    opacity: 0;
  }
}

@keyframes particle2 {
  0% {
    transform: translate(0, 0) scale(0);
    opacity: 0;
  }

  15% {
    transform: translate(20px, -25px) scale(1.3);
    opacity: 1;
  }

  55% {
    transform: translate(10px, -12px) scale(1);
    opacity: 0.7;
  }

  100% {
    transform: translate(-15px, 10px) scale(0.2);
    opacity: 0;
  }
}

/* 漩涡粒子动画 */
@keyframes spiralParticle1 {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) translateX(80px) rotate(0deg) scale(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(60deg) translateX(75px) rotate(-60deg) scale(1);
  }

  40% {
    transform: translate(-50%, -50%) rotate(240deg) translateX(50px) rotate(-240deg) scale(1.1);
    opacity: 0.9;
  }

  70% {
    transform: translate(-50%, -50%) rotate(480deg) translateX(25px) rotate(-480deg) scale(0.8);
    opacity: 0.6;
  }

  100% {
    transform: translate(-50%, -50%) rotate(720deg) translateX(0px) rotate(-720deg) scale(0);
    opacity: 0;
  }
}

@keyframes spiralParticle2 {
  0% {
    transform: translate(-50%, -50%) rotate(120deg) translateX(90px) rotate(-120deg) scale(0);
    opacity: 0;
  }

  12% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(180deg) translateX(85px) rotate(-180deg) scale(1);
  }

  45% {
    transform: translate(-50%, -50%) rotate(360deg) translateX(55px) rotate(-360deg) scale(1.2);
    opacity: 0.85;
  }

  75% {
    transform: translate(-50%, -50%) rotate(600deg) translateX(28px) rotate(-600deg) scale(0.7);
    opacity: 0.5;
  }

  100% {
    transform: translate(-50%, -50%) rotate(840deg) translateX(0px) rotate(-840deg) scale(0);
    opacity: 0;
  }
}

@keyframes spiralParticle3 {
  0% {
    transform: translate(-50%, -50%) rotate(240deg) translateX(70px) rotate(-240deg) scale(0);
    opacity: 0;
  }

  15% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(300deg) translateX(65px) rotate(-300deg) scale(1.1);
  }

  50% {
    transform: translate(-50%, -50%) rotate(540deg) translateX(40px) rotate(-540deg) scale(1);
    opacity: 0.8;
  }

  80% {
    transform: translate(-50%, -50%) rotate(720deg) translateX(18px) rotate(-720deg) scale(0.6);
    opacity: 0.4;
  }

  100% {
    transform: translate(-50%, -50%) rotate(900deg) translateX(0px) rotate(-900deg) scale(0);
    opacity: 0;
  }
}

@keyframes spiralParticle4 {
  0% {
    transform: translate(-50%, -50%) rotate(300deg) translateX(85px) rotate(-300deg) scale(0);
    opacity: 0;
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(380deg) translateX(78px) rotate(-380deg) scale(1.15);
  }

  52% {
    transform: translate(-50%, -50%) rotate(620deg) translateX(48px) rotate(-620deg) scale(1.05);
    opacity: 0.75;
  }

  82% {
    transform: translate(-50%, -50%) rotate(880deg) translateX(22px) rotate(-880deg) scale(0.65);
    opacity: 0.45;
  }

  100% {
    transform: translate(-50%, -50%) rotate(1080deg) translateX(0px) rotate(-1080deg) scale(0);
    opacity: 0;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 15px;
  }

  .header-logo {
    width: 50px !important;
    height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
  }

  header img {
    width: 50px !important;
    height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
  }

  .header-text {
    align-items: center;
  }

  h1 {
    font-size: 2rem;
    letter-spacing: 4px;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .intro-section,
  .divination-area,
  .result-section {
    padding: 25px;
  }

  .coin-container {
    gap: 15px;
  }

  .coin {
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
  }

  .hexagram-symbol {
    font-size: 3.5rem;
  }

  .hexagram-name {
    font-size: 2rem;
  }

  .action-button {
    padding: 15px 40px;
    font-size: 1.1rem;
  }
}