@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent !important;
  scrollbar-gutter: stable;
}

body {
  font-family: 'Inter', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* 自定义动画与特效 */
.glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.card-shadow {
  box-shadow: 0 10px 40px -10px rgba(37, 99, 235, 0.15);
}

/* 进度环动画 */
.progress-ring__circle {
  transition: stroke-dashoffset 0.35s;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* 模式切换动画 */
.mode-container {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
  display: none;
}

.mode-container.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* 按钮点击反馈 */
.btn-click:active {
  transform: scale(0.96);
}

.btn-bounce {
  animation: bounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 自定义确认弹窗动画 */
#confirm-modal.active #confirm-backdrop,
#prompt-modal.active #prompt-backdrop,
#export-format-modal.active #export-format-backdrop {
  opacity: 1;
}

#confirm-modal.active #confirm-panel,
#prompt-modal.active #prompt-panel,
#export-format-modal.active #export-format-panel {
  opacity: 1;
  transform: scale(1);
}

@keyframes bounce {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.95);
  }

  100% {
    transform: scale(1);
  }
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 选中态样式 */
.tab-active {
  color: #2563eb;
}

.nav-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: #2563eb;
  border-radius: 3px;
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, width;
}

.ft-mode-switch {
  position: relative;
  overflow: hidden;
}

.ft-mode-switch-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  width: 0;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  transition:
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, width;
}

.ft-mode-switching {
  animation: ftModeSwitch 0.24s ease;
}

@keyframes ftModeSwitch {
  0% {
    opacity: 0.78;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.line-through-animated {
  position: relative;
  opacity: 0.6;
}

.line-through-animated::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 2px;
  background: currentColor;
  animation: strike 0.3s ease-out forwards;
}

@keyframes strike {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

[x-cloak] {
  display: none !important;
}

#timer-adjust-controls {
  height: 10px;
}

.theme-dark {
  background: #020617 !important;
  color: #e2e8f0 !important;
}

.theme-dark .glass {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(148, 163, 184, 0.2);
}

.theme-dark .bg-white,
.theme-dark .bg-white\/95 {
  background-color: #0f172a !important;
}

.theme-dark .bg-slate-50,
.theme-dark .bg-slate-100 {
  background-color: #1e293b !important;
}

.theme-dark .text-slate-800,
.theme-dark .text-slate-700,
.theme-dark .text-slate-600 {
  color: #e2e8f0 !important;
}

.theme-dark .text-slate-500,
.theme-dark .text-slate-400,
.theme-dark .text-slate-300 {
  color: #94a3b8 !important;
}

.theme-dark .border-slate-100,
.theme-dark .border-slate-200 {
  border-color: #334155 !important;
}

.theme-dark .hover\:bg-slate-100:hover,
.theme-dark .hover\:bg-slate-200:hover {
  background-color: #334155 !important;
}

.theme-dark .card-shadow {
  box-shadow: 0 10px 45px -10px rgba(2, 6, 23, 0.75);
}

.focus-mode .bg-decor {
  display: none;
}

.focus-mode #launch-music-btn,
.focus-mode #nav-tabs-track .nav-tab[data-target='plan-mode'] {
  display: none;
}

.focus-mode #plan-mode {
  display: none !important;
}

.history-bar {
  box-shadow: 0 6px 14px -8px rgba(37, 99, 235, 0.9);
  transition: width 0.15s ease, opacity 0.15s ease;
}

/* 拖拽排序样式 */
[draggable='true'] {
  touch-action: auto;
}

.plan-drag-handle,
.exercise-edit-handle {
  cursor: grab;
}

.plan-drag-handle:active,
.exercise-edit-handle:active {
  cursor: grabbing;
}

.exercise-item {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.exercise-item:hover {
  background-color: #eff6ff !important;
}

.exercise-edit-row {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* 图表 Tooltip */
#chart-tooltip {
  transition:
    left 0.08s ease,
    top 0.08s ease;
}

/* 统计视图指示器 */
#stats-view-indicator {
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 图表柱动画 */
#stats-chart-bars .history-bar {
  animation: barGrow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  transform-origin: bottom;
}

@keyframes barGrow {
  from {
    transform: scaleY(0);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

#stats-chart-bars > div:nth-child(1) .history-bar { animation-delay: 0ms; }
#stats-chart-bars > div:nth-child(2) .history-bar { animation-delay: 30ms; }
#stats-chart-bars > div:nth-child(3) .history-bar { animation-delay: 60ms; }
#stats-chart-bars > div:nth-child(4) .history-bar { animation-delay: 90ms; }
#stats-chart-bars > div:nth-child(5) .history-bar { animation-delay: 120ms; }
#stats-chart-bars > div:nth-child(6) .history-bar { animation-delay: 150ms; }
#stats-chart-bars > div:nth-child(7) .history-bar { animation-delay: 180ms; }

/* 热力图 */
.heatmap-cell {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#heatmap-grid {
  scrollbar-width: none;
}

#heatmap-grid::-webkit-scrollbar {
  display: none;
}

/* 卡片折叠动画 */
.collapsible-body {
  transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease;
  max-height: 3000px;
  opacity: 1;
  overflow: hidden;
}

.collapsible-body.collapsed {
  max-height: 0 !important;
  opacity: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.collapse-chevron {
  transition: transform 0.3s ease;
}

.collapse-chevron.collapsed {
  transform: rotate(180deg);
}

.card-header-toggle {
  cursor: pointer;
  user-select: none;
}
