/* 记忆 App - 全局样式 */

:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background: #faf8f3;
  color: #1f2421;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(72px + var(--safe-bottom));
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
}

/* 卡片基础样式 */
.card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}
.card:active {
  transform: scale(0.98);
}

/* 按钮按压效果 */
button, .btn {
  transition: all 0.15s ease;
}
button:active, .btn:active {
  transform: scale(0.97);
}

/* 关键数字（艾宾浩斯天数）渐变效果 */
@keyframes countPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.count-pulse {
  animation: countPulse 0.3s ease;
}

/* 翻卡动画 */
.flip-card {
  perspective: 1000px;
}
.flip-card-inner {
  transition: transform 0.6s;
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}

/* 渐入动画 */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

/* 涟漪 */
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* 安全区适配 */
.safe-top {
  padding-top: var(--safe-top);
}
.safe-bottom {
  padding-bottom: var(--safe-bottom);
}
