/* ===== CSS Variables ===== */
:root {
  --bg-primary: rgba(10, 10, 10, 0.85);
  --accent-primary: #5BA3D9;
  --accent-light: #87CEEB;
  --accent-dark: #3A7BBF;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-muted: #666666;
  --border-color: rgba(42, 42, 42, 0.8);
}

/* ===== Body & Background ===== */
body {
  background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.65)), var(--bg-image) no-repeat 50% 0 !important;
  background-size: cover !important;
  background-attachment: fixed !important;
  color: var(--text-primary) !important;
  max-width: 1000px !important;
  padding: 20px !important;
  padding-top: 100px !important;
  margin: 0 auto !important;
  min-height: 100vh !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  line-height: 1.8 !important;
}


body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(91, 163, 217, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(135, 206, 235, 0.04) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* ===== Fixed Header ===== */
#header {
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important;
  z-index: 1000 !important;
  background: var(--bg-primary) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 16px 24px !important;
  display: flex !important;
  align-items: center !important;
  max-width: 100% !important;
}

#header .title-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

#header .avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  border: 2px solid var(--accent-primary) !important;
  box-shadow: 0 0 10px rgba(91, 163, 217, 0.3);
  transition: all 0.3s ease;
}

#header .avatar:hover {
  transform: scale(1.1) rotate(5deg);
  border-color: var(--accent-light);
  box-shadow: 0 0 20px rgba(91, 163, 217, 0.5);
}

#header .blogTitle {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-light)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  letter-spacing: 2px !important;
}

#header .title-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

#header .title-right a,
#header .title-right button {
  color: var(--text-secondary) !important;
  transition: color 0.3s ease !important;
}

#header .title-right a:hover,
#header .title-right button:hover {
  color: var(--accent-primary) !important;
}

/* ===== Post List (SideNav) ===== */
.SideNav-item {
  background: rgba(26, 26, 26, 0.9) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  margin-bottom: 16px !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: hidden !important;
}

.SideNav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-light), var(--accent-primary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.SideNav-item:hover {
  transform: translateY(-4px) !important;
  border-color: var(--accent-dark) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5), 0 4px 15px rgba(91, 163, 217, 0.15) !important;
}

.SideNav-item:hover::before {
  opacity: 1;
}

.SideNav-item a {
  color: var(--text-primary) !important;
  text-decoration: none !important;
}

.SideNav-item .listTitle {
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
}

.SideNav-item .Label {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent-primary)) !important;
  color: #000 !important;
  padding: 2px 10px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  border: none !important;
}

/* ===== Footer ===== */
#footer {
  background: rgba(18, 18, 18, 0.9) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  padding: 20px !important;
  margin-top: 40px !important;
  text-align: center !important;
  color: var(--text-muted) !important;
  font-size: 0.9rem !important;
}

#footer a {
  color: var(--text-secondary) !important;
  transition: color 0.3s ease;
}

#footer a:hover {
  color: var(--accent-primary) !important;
}

/* ===== Post Content ===== */
.markdown-body {
  background: rgba(26, 26, 26, 0.9) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  padding: 30px !important;
  color: var(--text-secondary) !important;
  margin-top: 20px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: var(--text-primary) !important;
}

.markdown-body a {
  color: var(--accent-primary) !important;
}

.markdown-body a:hover {
  color: var(--accent-light) !important;
}

.markdown-body pre {
  background: rgba(0,0,0,0.5) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
}

.markdown-body code {
  background: rgba(0,0,0,0.4) !important;
  color: var(--accent-light) !important;
}

.markdown-body blockquote {
  border-left-color: var(--accent-dark) !important;
  color: var(--text-muted) !important;
}

/* ===== Music Player ===== */
#music-player {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}

#music-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent-primary), var(--accent-light));
  border: 3px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 20px rgba(91, 163, 217, 0.5),
    0 0 30px rgba(91, 163, 217, 0.3),
    inset 0 0 15px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  padding: 0;
}

#music-btn::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  animation: none;
}

#music-btn.playing::before {
  animation: music-spin 8s linear infinite reverse;
}

#music-btn:hover {
  transform: scale(1.1);
  box-shadow:
    0 6px 30px rgba(91, 163, 217, 0.7),
    0 0 50px rgba(91, 163, 217, 0.5);
}

#music-btn:active {
  transform: scale(0.95);
}

#music-btn .icon {
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent rgba(10, 10, 10, 0.9);
  left: 50%;
  top: 50%;
  transform: translate(-35%, -50%);
  transition: all 0.3s ease;
}

#music-btn.playing .icon {
  border: none;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
}

#music-btn.playing .icon::before,
#music-btn.playing .icon::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 5px;
  background: rgba(10, 10, 10, 0.9);
  border-radius: 2px;
}

#music-btn.playing .icon::before {
  left: 0;
  height: 100%;
}

#music-btn.playing .icon::after {
  right: 0;
  height: 65%;
}

#music-btn .wave {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  opacity: 0;
}

#music-btn.playing .wave {
  animation: music-wave 1.5s ease-out infinite;
}

#music-btn.playing .wave:nth-child(2) {
  animation-delay: 0.5s;
}

#music-btn.playing .wave:nth-child(3) {
  animation-delay: 1s;
}

@keyframes music-wave {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes music-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== Light Mode Overrides ===== */
[data-color-mode="light"] body,
[data-color-mode="light"][data-light-theme="light"] body {
  background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.65)), var(--bg-image) no-repeat 50% 0 !important;
  background-size: cover !important;
  background-attachment: fixed !important;
  color: var(--text-primary) !important;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(91, 163, 217, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(91, 163, 217, 0.35);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  body {
    padding: 70px 10px 10px !important;
  }
  #header {
    padding: 12px 16px !important;
  }
  #header .blogTitle {
    font-size: 1.1rem !important;
  }
  #header .avatar {
    width: 32px !important;
    height: 32px !important;
  }
  #music-btn {
    width: 50px;
    height: 50px;
  }
  #music-btn .icon {
    border-width: 8px 0 8px 14px;
  }
  #music-btn.playing .icon {
    width: 14px;
    height: 14px;
  }
  #music-btn.playing .icon::before,
  #music-btn.playing .icon::after {
    width: 4px;
  }
  .SideNav-item {
    padding: 12px 14px !important;
  }
  .markdown-body {
    padding: 16px !important;
  }
}
