:root {
  --gutter: 24px;
  --radius: 16px;
  
  /* Vibrant Gradients & Colors for Modern Aesthetic */
  --color-primary: #ff4e6a;
  --color-primary-gradient: linear-gradient(135deg, #ff4e6a 0%, #ff761e 100%);
  --color2: #ff761e;
  --color3: #ffb900;
  --color4: #33d57a;
  --color5: #00dbff;
  --color6: #1a98ff;
  --color7: #9090ff;
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  --glass-blur: blur(20px);
  
  /* Base Colors */
  --color-card: var(--glass-bg);
  --color-text-1: #1a1a2e;
  --color-text-2: #4a4e69;
  --color-text-3: #9ca3af;
  --color-background: #f3f4f6;
  
  --drawer-width: 280px;
}

/* Premium Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --glass-bg: rgba(30, 30, 35, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    --color-card: var(--glass-bg);
    --color-text-1: #f3f4f6;
    --color-text-2: #d1d5db;
    --color-text-3: #9ca3af;
    --color-background: #0f0f13;
  }
}

*, *:before, *:after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { 
  font-size: 16px; 
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--color-text-2);
  background: var(--color-background);
  line-height: 1.8;
  overflow-x: hidden;
}

a { 
  color: inherit; 
  text-decoration: none; 
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); 
}
a:hover { color: var(--color-primary); }
img { max-width: 100%; border-radius: 8px; }

/* ---------------- BACKGROUND ---------------- */
#nexmoe-background {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  overflow: hidden;
  background: var(--color-background);
}

#nexmoe-background .nexmoe-bg {
  opacity: 0.4;
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(150%);
  height: 110vh;
  width: 110vw;
  position: fixed;
  top: -5%; left: -5%;
  z-index: -1;
  animation: pulseBg 20s infinite alternate linear;
}

@keyframes pulseBg {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* ---------------- DRAWER (SIDEBAR) ---------------- */
#nexmoe-header .mdui-drawer {
  position: fixed;
  top: 0;
  left: calc(var(--drawer-width) * -1);
  width: var(--drawer-width);
  height: 100vh;
  
  /* Glassmorphism Implementation */
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  
  z-index: 1000;
  overflow-y: auto;
  transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: none;
}
#nexmoe-header .mdui-drawer::-webkit-scrollbar { display: none; }
.drawer-open #nexmoe-header .mdui-drawer { left: 0; }

@media screen and (min-width: 1024px) {
  .nexmoe #nexmoe-header { margin-left: 0; }
  #nexmoe-header .mdui-drawer { left: 0 !important; }
}

/* Avatar Animation */
#nexmoe-header .nexmoe-avatar {
  margin: 45px auto 30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border: 4px solid var(--glass-border);
  position: relative;
}
#nexmoe-header .nexmoe-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
#nexmoe-header .nexmoe-avatar:hover img { 
  transform: scale(1.1) rotate(5deg); 
}

/* Sidebar List */
#nexmoe-header .nexmoe-count {
  padding: 0 30px 20px;
  display: flex;
}
#nexmoe-header .nexmoe-count div {
  flex: 1; text-align: center; color: var(--color-text-3); font-size: 13px;
}
#nexmoe-header .nexmoe-count div span {
  color: var(--color-text-1); display: block; font-size: 18px; font-weight: 600;
}

#nexmoe-header .nexmoe-list { padding: 8px 20px; }
#nexmoe-header .nexmoe-list .nexmoe-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px;
  color: var(--color-text-2);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  background: transparent;
}
#nexmoe-header .nexmoe-list .nexmoe-list-item:hover {
  background: rgba(255, 78, 106, 0.08);
  transform: translateX(5px);
  color: var(--color-primary);
}
#nexmoe-header .nexmoe-list .nexmoe-list-item.true {
  background: var(--color-primary-gradient);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 78, 106, 0.3);
  transform: translateY(-2px);
}
#nexmoe-header .nexmoe-list .nexmoe-list-item i { font-size: 18px; font-style: normal; }
#nexmoe-header .nexmoe-list .nexmoe-list-item.true i { color: #fff; }
#nexmoe-header .nexmoe-copyright {
  margin-top: 30px; text-align: center; color: var(--color-text-3); font-size: 12px;
}

/* ---------------- CONTENT AREA ---------------- */
#nexmoe-content { position: relative; }
#nexmoe-content .nexmoe-primary {
  /* Glassmorphism Implementation */
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  
  float: left;
  width: 100%;
  padding: 40px;
  min-height: 100vh;
  animation: fadeUpIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media screen and (min-width: 1024px) {
  .nexmoe { padding-left: var(--drawer-width); }
  #nexmoe-content .nexmoe-primary { width: 100%; border-radius: 24px 0 0 24px; margin-top: 20px; min-height: calc(100vh - 40px); }
}
@media screen and (max-width: 1023px) {
  #nexmoe-content .nexmoe-primary { padding: 24px; margin-top: 56px; }
}

/* ---------------- POST CARDS (MICRO-ANIMATIONS) ---------------- */
.nexmoe-posts { display: grid; gap: 40px; }
.nexmoe-post {
  width: 100%;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--radius);
}

.nexmoe-post:hover {
  transform: translateY(-8px);
}

.nexmoe-post .nexmoe-post-cover {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 16/7;
  background-color: #eee;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.nexmoe-post .nexmoe-post-cover img {
  display: block; position: absolute; left: 0; top: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.nexmoe-post:hover .nexmoe-post-cover img {
  transform: scale(1.05);
}

.nexmoe-post .nexmoe-post-cover h1 {
  position: absolute; bottom: 0; left: 0; z-index: 2;
  color: #fff; font-size: 2rem; width: 100%;
  margin: 0; padding: 30px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  font-weight: 700; letter-spacing: -0.5px;
  transition: transform 0.4s;
}
.nexmoe-post .nexmoe-post-cover::after {
  content: ''; display: block; position: absolute;
  bottom: 0; left: 0; width: 100%; height: 70%;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  z-index: 1; pointer-events: none;
}

/* Post Meta Badges */
.nexmoe-post .nexmoe-post-meta { margin-top: 16px; font-size: 13px; font-weight: 500; }
.nexmoe-post .nexmoe-post-meta a {
  border-radius: 30px;
  padding: 6px 16px;
  display: inline-block;
  background: rgba(255, 78, 106, 0.1);
  color: var(--color-primary);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 78, 106, 0.2);
  transition: all 0.3s;
}
.nexmoe-post .nexmoe-post-meta a:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 78, 106, 0.3);
}

/* ---------------- PAGINATION ---------------- */
.nexmoe-page-nav {
  display: flex; justify-content: center; gap: 12px; margin-top: 60px;
}
.nexmoe-page-nav > * {
  width: 44px; height: 44px; line-height: 44px; text-align: center;
  border-radius: 12px; font-weight: 600;
  background: rgba(150, 150, 150, 0.1);
  color: var(--color-text-2);
  transition: all 0.3s;
}
.nexmoe-page-nav .current {
  background: var(--color-primary-gradient);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 78, 106, 0.3);
  transform: scale(1.05);
}

/* ---------------- TOPBAR (MOBILE) ---------------- */
.mdui-toolbar {
  display: flex; align-items: center; height: 60px; padding: 0 16px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  position: fixed; width: 100%; top: 0; z-index: 900;
}
.mdui-toolbar-spacer { flex: 1; }
.mdui-btn-icon {
  background: transparent; border: none; font-size: 24px; color: var(--color-text-1); cursor: pointer;
}
.mdui-toolbar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
@media screen and (max-width: 1023px) {
  #nexmoe-background .mdui-appbar { display: block !important; }
} else {
  #nexmoe-background .mdui-appbar { display: none; }
}

/* ---------------- OVERLAY ---------------- */
.nexmoe-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
  z-index: 999; opacity: 0; pointer-events: none; transition: opacity .4s;
}
.drawer-open .nexmoe-overlay { opacity: 1; pointer-events: auto; }
@media screen and (min-width: 1024px) { .nexmoe-overlay { display: none; } }

/* Scrollbar Beautification */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(150,150,150,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }
::selection { background: var(--color-primary); color: #fff; }