
:root 
{
  --bg-base: #fafafa;
  --bg-primary: #fff;
  --bg-secondary: #f4f4f5;
  --bg-tertiary: #e4e4e7;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --accent-yellow: #4ea7e2;
  --accent-yellow-dim: rgb(251, 251, 69, 0.15);
  --accent-cyan: #4ea7e2;
  --accent-cyan-dim: rgb(251, 251, 69, 0.1);
  --list-marker: #18181b;
  --border-base: #aaa9a9;
  --border-active: #4ea7e2;
  --grid-color: rgb(0, 0, 0, 0.03);
}

@font-face
{
  font-family: 'NLT';
  src: url('fonts/NLT.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* 全局重置 */
* 
{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body
{
  background-color: #fff;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.container,
.sidebar,
.darkmode-toggle
{
  position: relative;
  z-index: 1;
}

.page-bg
{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('resources/background.webp') center / cover no-repeat;
  pointer-events: none;
}

.page-home .page-bg
{
  display: block;
}

.page-bg::before
{
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.page-home .site-title
{
  color: #fff;
}

.container
{
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 680px;
  width: 100%;
  padding: 40px 24px;
  text-align: center;
}

header
{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-title
{
  font-family: 'NLT', serif;
  font-size: 64px;
  color: #222;
  margin-bottom: 48px;
  letter-spacing: 2px;
  line-height: 1.3;
}

/* ===== 页脚 ===== */
footer
{
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 20px 24px;
  text-align: center;
  font-size: 13px;
  color: #aaa;
}

footer p
{
  margin: 0;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.page-home footer
{
  padding-bottom: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 66px, transparent 66px);
}

/*ABOUT*/
.page-about .container
{
  max-width: none;
}

.page-article .container
{
  max-width: 1300px;
}

.page-posts .container
{
  max-width: 1300px;
}

.page-archives .container
{
  max-width: 1300px;
}

.frame-card 
{
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 28px;
  text-align: left;
  border-radius: 12px;                
  
  background: var(--bg-primary);
  border: 1px solid var(--border-base);
  position: relative;                 /* 为伪元素锚点 */
  z-index: 10;                        
  
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1),
              0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 角标 */
.frame-card::before,
.frame-card::after 
{
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease; 
  z-index: 20;
  pointer-events: none;              /* 避免干扰鼠标事件 */
}

.frame-card::before 
{
  top: -1px;
  left: -1px;
  border-top: 3px solid var(--text-primary);
  border-left: 3px solid var(--text-primary);
  border-radius: 12px 0 0 0;      
}

.frame-card::after 
{
  bottom: -1px;
  right: -1px;
  border-bottom: 3px solid var(--text-primary);
  border-right: 3px solid var(--text-primary);
  border-radius: 0 0 12px 0;        
}

.frame-card:hover 
{
  border-color: var(--border-active);   
  box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.15), 
              0 4px 12px -4px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.frame-card:hover::before,
.frame-card:hover::after 
{
  opacity: 1;
  width: 16px;
  height: 16px;
}

.about-card-top
{
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.about-card-title
{
  font-size: 36px;
  font-weight: 700;
  color: #222;
  line-height: 1.2;
}

.about-card-avatar
{
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.about-card-body
{
  font-size: 15px;
  color: #555;
  line-height: 1.8;
}

.about-card-body p
{
  margin-bottom: 1em;
}

/*FRIENDS*/
.friends-grid 
{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.friend-card 
{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: var(--bg-secondary);       
  border: 1px solid var(--border-base);  
  border-radius: 12px;                 
  text-decoration: none;                
  transition: border-color 0.2s ease,  
              box-shadow 0.2s ease,
              transform 0.2s ease;
}

.friend-card:hover
{
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.friend-name 
{
  color: var(--text-primary);             
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}

.friend-status 
{
  color: var(--text-secondary);           
  font-size: 0.75rem;
  margin-top: 0.3rem;
  opacity: 0.6;
}

.friend-inactive 
{
  opacity: 0.5;
}

.page-friends .container
{
  max-width: none;
}

/*ARCHIVES*/
.page-archives .group a
{
  color: inherit;
  text-decoration: none;
}

.page-archives .group a .flex.gap-2
{
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.friends-card
{
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 32px 28px;
  text-align: left;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.friends-card:hover
{
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.friends-card-title
{
  font-family: 'NLT', serif;
  font-size: 48px;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
}

.friends-card-body
{
  font-size: 15px;
  color: #555;
  line-height: 1.8;
}

.friends-card-body p
{
  margin-bottom: 1em;
}

/*SEARCH*/
.page-search .container
{
  max-width: none;
  padding: 80px 24px 40px;
}

.search-wrapper
{
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  text-align: center;
}

.search-title
{
  font-family: 'NLT', serif;
  font-size: 64px;
  color: #222;
  margin-bottom: 8px;
}

.search-subtitle
{
  font-size: 14px;
  color: #999;
  margin-bottom: 32px;
}

.search-bar
{
  display: flex;
  width: 100%;
}

.search-bar input
{
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #ddd;
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 15px;
  outline: none;
  background: #fff;
  color: #333;
}

.search-bar input:focus
{
  border-color: #bbb;
}

.search-bar button
{
  width: 48px;
  height: 44px;
  border: 1px solid #ddd;
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
  color: #666;
  transition: background 0.2s;
}

.search-bar button:hover
{
  background: #eee;
}

/* Dark Mode */
.darkmode-toggle
{
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.darkmode-toggle input
{
  display: none;
}

.toggle-label
{
  display: block;
  width: 48px;
  height: 26px;
  background-color: #555;
  border-radius: 13px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s ease;
}

.toggle-knob
{
  display: block;
  width: 22px;
  height: 22px;
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
}

.darkmode-toggle input:checked + .toggle-label
{
  background-color: #555;
}

.darkmode-toggle input:checked + .toggle-label .toggle-knob
{
  transform: translateX(22px);
}

.back-to-top
{
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #555;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, background-color 0.2s ease, transform 0.2s ease;
}

.back-to-top.visible
{
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover
{
  background: #f0f0f0;
  transform: translateY(-2px);
}

.back-to-top svg
{
  width: 22px;
  height: 22px;
}

.music-toggle
{
  position: fixed;
  bottom: 90px;
  right: 32px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #555;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.music-toggle:hover
{
  background: #f0f0f0;
}

.music-wrapper:hover
{
  transform: translateY(-2px);
}

.music-toggle svg
{
  width: 22px;
  height: 22px;
}

.music-icon-pause
{
  display: none;
}

.music-toggle.playing .music-icon-play
{
  display: none;
}

.music-toggle.playing .music-icon-pause
{
  display: block;
}

.music-wrapper
{
  position: fixed;
  bottom: 90px;
  right: 32px;
  z-index: 100;
  width: 44px;
  height: 44px;
  transition: transform 0.2s ease;
}

.music-info
{
  position: absolute;
  right: 0;
  top: 0;
  width: 0;
  height: 44px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: width 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  padding-left: 18px;
}

.music-info.visible
{
  width: 285px;
  opacity: 0.5;
}

.music-info-text
{
  font-size: 14px;
  color: #555;
  padding-right: 14px;
  flex-shrink: 0;
}

.music-toggle
{
  position: absolute;
  bottom: 0;
  right: 0;
  flex-shrink: 0;
}

/* 🎵 particles animation  */
.music-particle
{
  position: fixed;
  z-index: 99;
  pointer-events: none;
  animation: musicParticle linear forwards;
  opacity: 0;
}

@keyframes musicParticle
{
  0%   { opacity: 0; transform: translateY(0); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-80px); }
}

/* Sidebar */
.sidebar
{
  position: fixed;
  top: 0;
  left: 0;
  width: 80px;
  height: 100vh;
  background-color: #fff;
  transition: width 0.3s ease;
  z-index: 99;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 24px;
  border-radius: 0 12px 12px 0;
  overflow: hidden;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-avatar
{
  display: block;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.sidebar.expanded .sidebar-avatar
{
  transform: rotate(120deg);
}

.sidebar-avatar:hover
{
  transform: scale(1.07);
}

.sidebar.expanded .sidebar-avatar:hover
{
  transform: rotate(120deg) scale(1.07);
}

.sidebar.expanded
{
  width: 256px;
}

.sidebar.instant,
.sidebar.instant *,
.sidebar.instant *::before,
.sidebar.instant *::after
{
  transition: none !important;
}

/* 页面切换淡出 */
body.page-leaving .container,
body.page-leaving .darkmode-toggle,
body.page-leaving .page-bg,
body.page-leaving.page-home footer,
body.page-leaving .music-toggle,
body.page-leaving .music-wrapper
{
  opacity: 0;
  transition: opacity 0.15s ease;
}

@keyframes contentFadeIn
{
  from { opacity: 0; }
  to { opacity: 1; }
}

.container,
.container,
.darkmode-toggle,
.page-home .page-bg,
.page-home footer,
.music-toggle,
.music-wrapper
{
  opacity: 0;
  animation: contentFadeIn 0.15s ease forwards;
}

.sidebar-nickname
{
  margin-top: 12px;
  font-size: 18px;
  color: #333;
  white-space: nowrap;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  user-select: none;
}

.sidebar.expanded .sidebar-nickname
{
  max-height: 36px;
  opacity: 1;
}

.sidebar-top
{
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 96px;
  flex-shrink: 0;
}

.sidebar-link
{
  display: block;
}

.sidebar-nav
{
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-indicator
{
  position: absolute;
  left: 0;
  width: 4px;
  background-color: #333;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
  z-index: -1;
  transition: top 0.3s ease, height 0.3s ease;
}

.sidebar-nav-item
{
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 12px 30px;
  border-radius: 8px;
  color: rgb(161, 161, 170);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active
{
  color: #333;
}

.sidebar-nav-item::before
{
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s ease;
  z-index: -1;
  pointer-events: none;
}

.sidebar-nav-item:hover::before
{
  transform: scaleX(1);
}

.sidebar-nav-item.active::before,
.sidebar-nav-item.active:hover::before
{
  transform: scaleX(0);
}

.sidebar-nav-item.active::after
{
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 0;
  z-index: -2;
  pointer-events: none;
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.sidebar-nav-item.leaving::after
{
  transform: scaleX(0);
}

.sidebar-nav-text
{
  overflow: hidden;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  transition: max-width 0.3s ease, opacity 0.3s ease;
}

.sidebar.expanded .sidebar-nav-text
{
  max-width: 180px;
  opacity: 1;
}

.sidebar-nav-icon
{
  width: 20px;
  height: 24px;
  flex-shrink: 0;
}

/*Tailwind CSS*/
/* ============================================
   1. 布局
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.min-w-0 { min-width: 0px; }

/* ============================================
   2. 间距
   ============================================ */
.mb-16 { margin-bottom: 4rem; }      /* 16 * 0.25rem */
.mb-8 { margin-bottom: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.p-4 { padding: 1rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pr-4 { padding-right: 1rem; }
.pl-6 { padding-left: 1.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* 纵向堆叠间距 (space-y-2) */
.space-y-2 > * + * { margin-top: 0.5rem; }

/* ============================================
   3. 定位
   ============================================ */
.relative { position: relative; }
.absolute { position: absolute; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.top-1\/2 { top: 50%; }
.-top-4 { top: -1rem; }
.-left-2 { left: -0.5rem; }
.left-2 { left: 0.5rem; }
.-mt-px { margin-top: -1px; }
.-mt-1 { margin-top: -0.25rem; }
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }

/* 任意值 (对应 left-[-1.5rem] 等) */
.left-\[-1\.5rem\] { left: -1.5rem; }
.left-\[-1\.7rem\] { left: -1.7rem; }

/* ============================================
   4. 尺寸
   ============================================ */
.w-px { width: 1px; }
.h-px { height: 1px; }
.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.w-4 { width: 1rem; }

/* ============================================
   5. 排版
   ============================================ */
.text-6xl { font-size: 3.75rem; line-height: 1; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-\[10px\] { font-size: 10px; }
.font-black { font-weight: 900; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-none { user-select: none; }
.text-black { color: #000; }

.bg-\[var\(--bg-base\)\] { background-color: var(--bg-base); }
.border-\[var\(--border-base\)\] { border-color: var(--border-base); }
.text-\[var\(--text-secondary\)\] { color: var(--text-secondary); }
.text-\[var\(--text-muted\)\] { color: var(--text-muted); }

.border-b { border-bottom: 1px solid var(--border-base); }
.border-r { border-right: 1px solid var(--border-base); }
.border { border: 1px solid var(--border-base); }
.rounded-full { border-radius: 9999px; }

.opacity-20 { opacity: 0.2; }
.opacity-70 { opacity: 0.7; }

/* ============================================
   6. 过渡与变换
   ============================================ */
.transition-all { transition: all 0.2s ease; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.transition-transform { transition: transform 0.2s ease; }

/* ============================================
   7. 响应式断点 (md: 对应屏幕 ≥ 768px)
   ============================================ */
@media (min-width: 768px) 
{
  .md\:flex-row { flex-direction: row; }
  .md\:items-center { align-items: center; }
  .md\:pl-10 { padding-left: 2.5rem; }
  .md\:left-4 { left: 1rem; }
  .md\:left-\[-2\.5rem\] { left: -2.5rem; }
  .md\:left-\[-2\.7rem\] { left: -2.7rem; }
  .md\:w-8 { width: 2rem; }
  .md\:w-32 { width: 8rem; }
  .md\:text-base { font-size: 1rem; line-height: 1.5rem; }
  .md\:block { display: block; }
}

/* ============================================
   8. Group 悬停机制
   ============================================ */
/* 父容器 .group 本身无需样式，作为悬停触发的锚点 */

/* 当 .group 被悬停时，修改内部带 group-hover 类的子元素 */
.group:hover .group-hover\:bg-\[\#FBFB45\] { background-color: #FBFB45; }
.group:hover .group-hover\:text-black { color: #000; }
.group:hover .group-hover\:border-black\/20 { border-color: rgba(0, 0, 0, 0.2); }
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:translate-x-1 { transform: translateX(0.25rem); }

/* 针对时间轴横线 (border 变背景色) */
.group:hover .group-hover\:bg-\[var\(--text-primary\)\] 
{
  background-color: var(--text-primary);
}
/* 针对时间轴圆点 (边框变色) */
.group:hover .group-hover\:border-\[var\(--text-primary\)\] 
{
  border-color: var(--text-primary);
}