/**
 * Project: EnneaFlow
 * File: style.css
 */

:root {
  /* 明亮模式 */
  --bg: #f6f6f4;
  --surface: #f2f2f0;
  --border: #e0e0dc;
  --text-main: #111111;
  --text-sub: #555555;
  --accent: #666666;
  --highlight: #d4d4d2;

  /* 礦石調色盤 */
  --mineral-red: #b3544d;
  --mineral-grey: #8a8b88;
  --mineral-gold: #a68b67;
}

.dark {
  /* 深色模式 */
  --bg: #1a1a1a;
  --surface: #242424;
  --border: #404040;
  --text-main: #f0f0f0;
  --text-sub: #b0b0b0;
  --accent: #999999;
  --highlight: #555555;

  --mineral-red: #d97d75;
  --mineral-grey: #7d8288;
  --mineral-gold: #c2a886;
}

body {
  font-family: "Noto Sans TC", sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  transition:
    background-color 0.6s cubic-bezier(0.23, 1, 0.32, 1),
    color 0.6s ease;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.6;
}

.serif {
  font-family: "Playfair Display", serif;
}

/* 按鈕美學 */
.ak-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  letter-spacing: 0.1em;
  font-weight: 700;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.ak-btn:hover:not(:disabled) {
  border-color: var(--text-sub);
  transform: translateY(-2px);
  background: var(--bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.ak-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 輸入框美學 */
.ak-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  color: var(--text-main);
  font-family: "Playfair Display", serif;
  text-align: center;
  transition: border-color 0.3s ease;
  padding: 0 1rem;
}
.ak-input:focus {
  border-bottom-color: var(--text-main);
  outline: none;
}

/* 九宮格結構 */
.grid-container {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  position: relative;
}
.grid-cell {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.02);
  z-index: 1;
}

/* 能量連線與呼吸圈 */
.connection-line {
  position: absolute;
  background: var(--text-main);
  border-radius: 99px;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}
.circle-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid currentColor;
  z-index: 20;
  animation: energy-breath 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes energy-breath {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.02);
    opacity: 0.9;
  }
}

.line-h {
  height: 6px;
  left: 8%;
  right: 8%;
}
.line-v {
  width: 6px;
  top: 8%;
  bottom: 8%;
}
.line-123 {
  bottom: 16%;
}
.line-456 {
  top: 50%;
  transform: translateY(-50%);
}
.line-789 {
  top: 16%;
}
.line-147 {
  left: 16%;
}
.line-258 {
  left: 50%;
  transform: translateX(-50%);
}
.line-369 {
  left: 84%;
}
.line-diag {
  height: 6px;
  width: 130%;
}
.line-159 {
  top: 5%;
  left: 5%;
  transform: rotate(45deg);
  transform-origin: top left;
}
.line-357 {
  top: 5%;
  right: 5%;
  transform: rotate(-45deg);
  transform-origin: top right;
}

/* 質感雜訊與過場動畫 */
.noise-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}
.animate-fade-up {
  animation: fadeUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  opacity: 0;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 截圖穩定器防斷頭 */
.force-capture-916 {
  width: 420px !important;
  padding: 60px 48px !important;
  background: var(--bg) !important;
  display: block !important;
}
.force-capture-916 .animate-fade-up {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}
.no-print {
  @media print {
    display: none !important;
  }
}
