:root {
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --text-primary: #d4c4a8;
  --text-secondary: #8a7a5e;
  --accent-gold: #c9a227;
  --accent-red: #8b0000;
  --border-gold: rgba(201, 162, 39, 0.3);

  --font-main: "Noto Serif SC", "思源宋体", "楷体", serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
    ellipse at center,
    rgba(201, 162, 39, 0.03) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.page {
  display: none;
  width: 100%;
  flex: 1;
  align-items: center;
  justify-content: center;
}

.page.active {
  display: flex;
}

.temple-container {
  width: 100%;
  max-width: 800px;
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.bagua-wrapper {
  margin-bottom: 10px;
}

.bagua-icon {
  width: 100px;
  height: 100px;
  animation: spin 12s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.5em;
  margin: 0;
}

.subtitle {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--text-secondary);
  letter-spacing: 0.3em;
  margin: 0;
}

.form-wrapper {
  width: 100%;
  max-width: 600px;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: flex;
  gap: 20px;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
}

.form-group.full-width {
  width: 100%;
}

.form-group label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.required {
  color: var(--accent-red);
  color: #c9a227;
}

.optional {
  font-size: 0.8rem;
  opacity: 0.7;
}

.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.3s;
}

.form-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.15);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

.gender-group {
  flex: 0.6;
}

.radio-group {
  display: flex;
  gap: 20px;
  height: 100%;
  align-items: center;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1rem;
}

.radio-label input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-gold);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

.radio-label input[type="radio"]:checked {
  border-color: var(--accent-gold);
  background: var(--accent-gold);
}

.radio-label input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: var(--bg-dark);
  border-radius: 50%;
}

.datetime-group {
  width: 100%;
}

.datetime-inputs {
  display: flex;
  gap: 15px;
  width: 100%;
}

.date-input {
  flex: 1.2;
}

.time-input {
  flex: 0.8;
}

input[type="date"],
input[type="time"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(3) hue-rotate(15deg);
  cursor: pointer;
}

.question-input {
  resize: none;
  min-height: 60px;
}

.hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
  margin-top: 10px;
}

.btn-primary {
  background: linear-gradient(180deg, #2a2520 0%, #1a1815 100%);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 16px 50px;
  font-size: 1.1rem;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 4px;
  white-space: nowrap;
  margin-top: 10px;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #3a352a 0%, #2a2520 100%);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.2);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
  padding: 12px 28px;
  font-size: 0.95rem;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.15em;
}

.btn-secondary:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 15, 0.96);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  gap: 50px;
}

.bagua-container {
  position: relative;
}

.bagua-icon-large {
  width: 150px;
  height: 150px;
  animation: spin 6s linear infinite;
  filter: drop-shadow(0 0 20px rgba(201, 162, 39, 0.4));
}

.status {
  text-align: center;
}

.main-text {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  color: var(--text-primary);
  letter-spacing: 0.4em;
  margin: 0 0 15px 0;
}

.sub-text {
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  color: var(--accent-gold);
  letter-spacing: 0.3em;
  margin: 0;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.result-container {
  width: 100%;
  max-width: 700px;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 1rem;
}

.header h2 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.3em;
  margin: 0;
}

.divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-gold),
    transparent
  );
  margin-bottom: 25px;
}

.content {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 2;
  color: var(--text-primary);
  min-height: 100px;
  text-align: left;
}

.cursor {
  color: var(--accent-gold);
  animation: blink 0.8s infinite;
}

.cursor.hidden {
  display: none;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.disclaimer {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 20px;
  opacity: 0;
  transition: opacity 0.5s;
  letter-spacing: 0.1em;
}

.disclaimer.visible {
  opacity: 1;
}

.actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 25px;
  opacity: 0;
  transition: opacity 0.5s;
}

.actions.visible {
  opacity: 1;
}

.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  padding: 15px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 3px;
  pointer-events: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 3px;
}

@media (max-width: 600px) {
  .temple-container {
    padding: 30px 15px;
  }

  .form-row {
    flex-direction: column;
    gap: 15px;
  }

  .gender-group {
    flex: 1;
  }

  .datetime-inputs {
    flex-direction: column;
    gap: 10px;
  }

  .date-input,
  .time-input {
    flex: 1;
  }

  .btn-primary {
    width: 100%;
    padding: 14px 24px;
  }

  .bagua-icon {
    width: 80px;
    height: 80px;
  }

  .result-container {
    padding: 25px 20px;
    margin: 0 10px;
  }

  .actions {
    flex-direction: column;
    gap: 12px;
  }

  .btn-secondary {
    width: 100%;
  }
}
