/* Custom CSS overrides for Lunarveil's Blog */
/* Forces cherry red color scheme and fixes UI elements */

/* ===== Post Cover Card Background ===== */
.post-cover {
  background: var(--red-4);
  border-radius: 10px;
  overflow: hidden;
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-wrap:hover .post-cover img {
  transform: scale(1.05);
}

/* ===== Sidebar Floating (auto-show on scroll) ===== */
.sidebar-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  width: 45px;
  height: 45px;
  background: var(--color-wrap, #fff);
  border: 1px solid var(--red-3, #ffafaf);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  opacity: 0.85;
  visibility: visible;
}

.sidebar-top:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.sidebar-top .sidebar-top-taichi {
  width: 24px;
  height: 24px;
}

.sidebar-top .arrow-up {
  display: none;
}

/* ===== Sidebar Widget Styling ===== */
.sidebar-wrap {
  background: var(--color-wrap, #fff);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* ===== Code Block Styling ===== */
div.highlight {
  border-radius: 8px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar-thumb {
  background-color: #ff5252 !important;
  border-radius: 10px;
}

::-webkit-scrollbar-track {
  background-color: #f5f5f5;
  border-radius: 10px;
}

/* ===== Link Colors ===== */
a {
  color: #ff5252;
}

a:hover {
  color: #ff7c7c;
}

/* ===== Tag Styling ===== */
.tag-link, .article-tag-list-link {
  color: #ff5252 !important;
  border-color: #ffafaf !important;
}

.tag-link:hover, .article-tag-list-link:hover {
  background: #ff5252 !important;
  color: #fff !important;
}

/* ===== Navigation Active ===== */
.main-nav-link-wrap:hover .main-nav-link,
.sidebar-menu-link-wrap.link-active .sidebar-menu-link {
  color: #ff5252;
}

/* ===== Post Title Hover ===== */
.post-title:hover {
  color: #ff5252;
}

/* ===== Pagination ===== */
.page-number.current {
  background: #ff5252;
}

/* ===== Dark Mode Adjustments ===== */
[data-theme="dark"] .sidebar-top {
  background: var(--color-wrap, #272b30);
  border-color: rgba(255, 175, 175, 0.3);
}

[data-theme="dark"] a {
  color: #ff7c7c;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background-color: #ff5252 !important;
}

/* ===== Desktop Lyrics Window Drag Enhancement ===== */
/* 拖拽功能增强样式（原版没有，自定义增加） */
.native-player-desktop-lyrics {
  cursor: grab;
  user-select: none;
}

.native-player-desktop-lyrics:active,
.native-player-desktop-lyrics.is-dragging {
  cursor: grabbing;
}

.native-player-desktop-lyrics.is-dragging {
  transition: none;
}

/* Keep the draggable lyrics window above the expanded player dock. */
.native-player-desktop-lyrics {
  z-index: 1;
}

.native-player-lyrics-kicker {
  cursor: grab;
}

.native-player-lyrics-kicker:active {
  cursor: grabbing;
}

/* ===== Image Fallback ===== */
.article-entry img:not(.lazyload) {
  opacity: 1;
}

.article-image-fallback {
  display: block;
  margin: 16px auto;
  padding: 14px 16px;
  max-width: 720px;
  border: 1px dashed var(--red-3);
  border-radius: 10px;
  background: var(--red-6);
  color: var(--red-1) !important;
  text-align: center;
  font-weight: 700;
  box-shadow: var(--shadow-meta);
}

/* ===== Native Player: approved “莓蓝玻璃胶囊” dock ===== */
@media (min-width: 960px) {
  .native-player-shell .native-player-dock {
    width: min(calc(100vw - 48px), 1140px);
    max-width: 1140px;
  }

  .native-player-shell .native-player-dock-handle {
    width: 72px;
    height: 6px;
    margin-bottom: 4px;
    background: var(--red-2);
    box-shadow: 0 0 14px var(--red-2);
    opacity: .72;
  }

  .native-player-shell .native-player-dock-panel {
    position: relative;
    overflow: visible;
    padding: 12px 18px;
    border: 1px solid color-mix(in srgb, var(--red-2) 42%, rgba(255, 255, 255, .26));
    border-radius: 999px;
    background: linear-gradient(100deg, rgba(26, 59, 91, .92), rgba(62, 111, 150, .82) 52%, rgba(45, 68, 103, .88));
    box-shadow: 0 18px 44px rgba(9, 18, 34, .26), inset 0 1px rgba(255, 255, 255, .2), 0 0 0 1px rgba(255, 156, 190, .08);
    backdrop-filter: blur(18px) saturate(1.18);
    -webkit-backdrop-filter: blur(18px) saturate(1.18);
  }

  .native-player-shell .native-player-taskbar-left,
  .native-player-shell .native-player-taskbar-right,
  .native-player-shell .native-player-dock-spectrum {
    display: none;
  }

  .native-player-shell .native-player-dock-main {
    display: grid;
    grid-template-columns: auto 58px minmax(180px, 1fr) minmax(170px, 1.15fr) auto;
    align-items: center;
    gap: 14px;
    min-width: 0;
  }

  .native-player-shell .native-player-dock-controls { grid-column: 1; grid-row: 1; gap: 6px; min-width: 0; }
  .native-player-shell .native-player-dock-album { grid-column: 2; grid-row: 1; width: 58px; height: 58px; }
  .native-player-shell .native-player-dock-meta { grid-column: 3; grid-row: 1; width: auto; min-width: 0; }
  .native-player-shell .native-player-dock-progress { grid-column: 4; grid-row: 1; min-width: 0; width: auto; }
  .native-player-shell .native-player-dock-tools { grid-column: 5; grid-row: 1; min-width: 0; gap: 8px; flex-wrap: nowrap; }

  .native-player-shell .native-player-dock-cover {
    width: 58px;
    height: 58px;
    border: 2px solid color-mix(in srgb, var(--red-2) 72%, #fff 28%);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(18, 28, 44, .36), 0 8px 18px rgba(0, 0, 0, .2);
  }

  .native-player-shell .native-player-dock-album-ring {
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-2), transparent 68%);
    opacity: .82;
  }

  .native-player-shell .native-player-dock-title {
    overflow: hidden;
    color: #f3f8ff;
    font-size: 16px;
    letter-spacing: .04em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .native-player-shell .native-player-dock-artist,
  .native-player-shell .native-player-dock-line {
    overflow: hidden;
    color: #b8d3e7;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .native-player-shell .native-player-dock-progress { gap: 9px; color: #c0d9eb; font-size: 11px; }
  .native-player-shell .native-player-dock-progress .native-player-range { height: 4px; background: rgba(255,255,255,.22); }
  .native-player-shell .native-player-dock-progress .native-player-range::-webkit-slider-thumb { width: 10px; height: 10px; }

  .native-player-shell .native-player-dock-controls .native-player-button {
    flex: 0 0 32px;
    min-width: 32px;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: #b6d8ee;
    font-size: 0;
    box-shadow: none;
  }

  .native-player-shell .native-player-dock-controls .native-player-button::before { font-size: 19px; line-height: 1; }
  .native-player-shell .native-player-dock-controls .native-player-button:nth-child(1)::before { content: '◀'; }
  .native-player-shell .native-player-dock-controls .native-player-button:nth-child(3)::before { content: '▶'; }

  .native-player-shell .native-player-dock-controls .native-player-button--primary {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    min-height: 52px;
    color: #19334f;
    background: #c8e5f8;
    border: 2px solid rgba(244, 159, 191, .82);
    box-shadow: 0 8px 18px rgba(5, 18, 35, .26), inset 0 1px rgba(255,255,255,.72);
  }

  .native-player-shell .native-player-dock-controls .native-player-button--primary::before { content: '▶'; font-size: 16px; }
  .native-player-shell .native-player-dock-controls .native-player-button--primary.is-active::before { content: 'Ⅱ'; font-size: 15px; }
  .native-player-shell .native-player-dock-controls .native-player-button:hover { color: #fff; background: rgba(255,255,255,.12); transform: translateY(-1px); }
  .native-player-shell .native-player-dock-controls .native-player-button--primary:hover { color: #19334f; background: #ddf1ff; }

  .native-player-shell .native-player-dock-tools .native-player-pill,
  .native-player-shell .native-player-dock-tools .native-player-volume {
    color: #d6ebf8;
    font-size: 11px;
  }

  .native-player-shell .native-player-dock-tools .native-player-pill {
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.1);
  }

  .native-player-shell .native-player-dock-tools .native-player-pill:hover,
  .native-player-shell .native-player-dock-tools .native-player-pill.is-active {
    color: #17324e;
    background: #d4ecfb;
  }

  .native-player-shell .native-player-dock-playlist {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    left: 0;
    max-height: 0;
    margin: 0;
    padding: 0 18px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 22px;
    background: rgba(19, 34, 54, .94);
    box-shadow: 0 18px 40px rgba(7, 18, 34, .25);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .native-player-shell.is-playlist-open .native-player-dock-playlist {
    max-height: 300px;
    margin: 0;
    padding: 14px 18px;
    border-color: rgba(255, 166, 195, .22);
  }

  .native-player-shell .native-player-dock-playlist .native-player-track-list { max-height: 270px; }
  .native-player-shell .native-player-dock-playlist .native-player-track { color: #dcefff; background: rgba(255,255,255,.08); }
  .native-player-shell .native-player-dock-playlist .native-player-track:hover { background: rgba(255,255,255,.14); }
  .native-player-shell .native-player-dock-playlist .native-player-track.is-active { color: #17324e; background: #cce8fa; }

  .native-player-shell .native-player-status-pill { display: none; }
  .native-player-shell .native-player-desktop-lyrics { bottom: 106px; }
}

@media (min-width: 960px) and (max-width: 1180px) {
  .native-player-shell .native-player-dock-main { grid-template-columns: auto 52px minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 9px; }
  .native-player-shell .native-player-dock-album,
  .native-player-shell .native-player-dock-cover { width: 52px; height: 52px; }
  .native-player-shell .native-player-dock-tools .native-player-volume { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .native-player-shell.is-playing .native-player-dock-cover,
  .native-player-shell.is-playing .native-player-dock-spectrum span { animation: none !important; }
  .native-player-shell .native-player-dock-panel,
  .native-player-shell .native-player-dock-playlist,
  .native-player-shell .native-player-dock-controls .native-player-button { transition: none !important; }
}
