/**
 * 背景固定放大 · 仅小路+按钮横向滚动
 */

.cp-root--horizontal {
  width: 100%;
  margin-bottom: var(--space-xl, 24px);
}

/* 可视窗口：背景钉在这里不动 */
.cp-viewport {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 4px 20px rgba(62, 52, 38, 0.08);
  overflow: hidden;
}

/* 固定背景层（不随滚动条移动） */
.cp-bg-fixed {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cp-bg-fill {
  position: absolute;
  inset: 0;
  background: #faf6ef;
}

.cp-root--no-bg-img .cp-bg-fill {
  background:
    linear-gradient(180deg, #b8d4a8 0%, #8fbc8f 35%, #6b9b6e 60%, #5a8a5c 100%);
}

.cp-root--no-bg-img .cp-viewport::after {
  content: '请将 course-path-frame.png 放入 images 文件夹后刷新';
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(40, 70, 45, 0.55);
  padding: 4px 10px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}

.cp-bg-img {
  position: absolute;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  user-select: none;
}

.cp-watermark-mask {
  position: absolute;
  width: 148px;
  height: 52px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 80% at 100% 100%, rgba(72, 130, 70, 0.55) 0%, rgba(72, 130, 70, 0.2) 45%, transparent 70%),
    linear-gradient(145deg, transparent 0%, rgba(250, 246, 239, 0.88) 35%, #f5f0e6 100%);
  border-bottom-right-radius: 8px;
}

/* 滚动层：透明，只滚小路和按钮 */
.cp-scroll {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(42, 155, 116, 0.45) transparent;
}

.cp-scroll::-webkit-scrollbar {
  height: 7px;
}

.cp-scroll::-webkit-scrollbar-thumb {
  background: rgba(42, 155, 116, 0.45);
  border-radius: 999px;
}

.cp-scroll--wide {
  box-shadow: inset -10px 0 14px -10px rgba(0, 0, 0, 0.05);
}

.cp-path-layer {
  position: relative;
}

.cp-path-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cp-path-shadow {
  fill: none;
  stroke: rgba(160, 140, 110, 0.2);
  stroke-width: 38;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: blur(2px);
}

.cp-path-edge {
  fill: none;
  stroke: rgba(210, 190, 160, 0.55);
  stroke-width: 32;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cp-path-line {
  fill: none;
  stroke: url(#cp-path-grad);
  stroke: #ede3d0;
  stroke-width: 24;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cp-nodes {
  position: absolute;
  inset: 0;
}

.cp-day-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 72px;
  height: var(--cp-btn-h, 2.2rem);
  padding: 0 14px;
  border-radius: 52% 48% 55% 45% / 48% 52% 46% 54%;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    filter 0.22s ease;
}

.cp-day-btn--pebble-1 {
  border-radius: 48% 52% 50% 50% / 52% 48% 54% 46%;
}

.cp-day-btn--pebble-2 {
  border-radius: 55% 45% 48% 52% / 46% 54% 50% 50%;
}

.cp-day-btn--pebble-0 {
  border-radius: 50% 50% 45% 55% / 54% 46% 52% 48%;
}

.cp-day-btn:nth-child(3n+1) {
  border-radius: 48% 52% 50% 50% / 52% 48% 54% 46%;
}

.cp-day-btn:nth-child(3n+2) {
  border-radius: 55% 45% 48% 52% / 46% 54% 50% 50%;
}

.cp-day-btn:nth-child(3n) {
  border-radius: 50% 50% 45% 55% / 54% 46% 52% 48%;
}

.cp-day-btn:disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.cp-day-btn:not(:disabled):hover {
  transform: translate(-50%, -50%) scale(1.08);
  filter: brightness(1.06);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.95),
    0 0 20px rgba(255, 210, 100, 0.8),
    0 0 36px rgba(255, 180, 60, 0.4),
    0 4px 14px rgba(80, 60, 30, 0.14);
  z-index: 10;
}

.cp-day-btn--listened {
  background: linear-gradient(165deg, #f7fcf8 0%, #edf7f0 100%);
  color: #43a047;
  border: 2px solid #b9dfc4;
  box-shadow: 0 2px 8px rgba(129, 199, 132, 0.12);
}

.cp-day-btn--completed {
  background: linear-gradient(165deg, #f1fbf4 0%, #d9f2e1 100%);
  color: #2e7d52;
  border: 2px solid #8fd4a8;
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.18);
}

.cp-day-btn--completed:not(:disabled):hover {
  background: linear-gradient(165deg, #e8f7ec 0%, #c8ebd6 100%);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.95),
    0 0 16px rgba(129, 199, 132, 0.55),
    0 4px 14px rgba(46, 125, 82, 0.12);
}

.cp-day-btn--current {
  background: linear-gradient(165deg, #fff8e1 0%, #ffd54f 100%);
  color: #5d4037;
  border: 2px solid #ffb300;
  box-shadow: 0 0 0 3px rgba(255, 224, 130, 0.45), 0 0 14px rgba(255, 193, 7, 0.45);
  z-index: 5;
}

.cp-day-btn--available {
  background: #fff;
  color: #33691e;
  border: 2px solid #7cb342;
}

.cp-day-btn--locked {
  background: rgba(255, 255, 255, 0.72);
  color: #b0a898;
  border: 1.5px dashed #d5cfc3;
}

@media (max-width: 480px) {
  .cp-day-btn {
    min-width: 68px;
    font-size: 12px;
    padding: 0 12px;
  }

  .cp-watermark-mask {
    width: 120px;
    height: 44px;
  }
}
