/* 侧边栏布局样式 */
body.cc-sidebar-layout {
  background: #f7fbff;
  margin: 0;
  padding: 0;
}

body.cc-sidebar-layout .cc-horizontal-menu {
  display: none !important;
}

body.cc-sidebar-layout .cc-menu-spacer {
  display: none;
}

/* 主内容包装器 */
.cc-main-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.cc-sidebar-layout .cc-main-wrapper {
  margin-left: 260px;
  width: calc(100% - 260px);
}

body.cc-sidebar-layout .user-center-container,
body.cc-sidebar-layout .container,
body.cc-sidebar-layout main {
  flex: 1;
  max-width: 100%;
  padding: 24px 32px;
}

body.cc-sidebar-layout .cc-footer {
  margin: 32px 32px 24px;
  width: auto;
}

body.cc-sidebar-layout .cc-footer-container {
  max-width: 100%;
}

/* 侧边栏容器 */
.cc-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: rgba(255,255,255,0.95);
  border-right: 1px solid rgba(226,232,240,0.8);
  box-shadow: 4px 0 24px rgba(15,23,42,0.08);
  backdrop-filter: saturate(180%) blur(20px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cc-sidebar::-webkit-scrollbar {
  width: 6px;
}

.cc-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.cc-sidebar::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.3);
  border-radius: 3px;
}

.cc-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(148,163,184,0.5);
}

/* 侧边栏Logo */
.cc-sidebar-logo {
  display: flex;
  align-items: center;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(226,232,240,0.6);
  text-decoration: none;
  color: #0f172a;
  font-weight: 700;
  font-size: 18px;
  gap: 12px;
  transition: all .2s ease;
}

.cc-sidebar-logo:hover {
  color: #2563eb;
  text-decoration: none;
}

.cc-sidebar-logo img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 4px 12px rgba(37,99,235,0.25));
}

/* 侧边栏导航 */
.cc-sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cc-sidebar-item {
  position: relative;
}

.cc-sidebar-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-radius: 12px;
  transition: all .2s ease;
  position: relative;
  gap: 12px;
}

.cc-sidebar-link i {
  font-size: 20px;
  min-width: 20px;
  text-align: center;
}

.cc-sidebar-link:hover {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #2563eb;
  text-decoration: none;
  transform: translateX(4px);
}

.cc-sidebar-link.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37,99,235,0.3);
}

.cc-sidebar-link.active i {
  animation: ccIconPulse 2s ease-in-out infinite;
}

@keyframes ccIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* 侧边栏下拉菜单 */
.cc-sidebar-dropdown {
  position: relative;
}

.cc-sidebar-dropdown-toggle::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .2s ease;
}

.cc-sidebar-dropdown.open .cc-sidebar-dropdown-toggle::after {
  transform: translateY(-50%) rotate(180deg);
}

.cc-sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  padding-left: 32px;
}

.cc-sidebar-dropdown.open .cc-sidebar-submenu {
  max-height: 500px;
}

.cc-sidebar-submenu .cc-sidebar-link {
  padding: 10px 16px;
  font-size: 13px;
}

/* 侧边栏用户区域 */
.cc-sidebar-user {
  padding: 16px 12px;
  border-top: 1px solid rgba(226,232,240,0.6);
}

.cc-sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 12px;
  text-decoration: none;
  color: #0f172a;
  transition: all .2s ease;
  cursor: pointer;
}

.cc-sidebar-user-info:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37,99,235,0.3);
}

.cc-sidebar-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.cc-sidebar-user-details {
  flex: 1;
  min-width: 0;
}

.cc-sidebar-user-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-sidebar-user-role {
  font-size: 12px;
  opacity: 0.7;
}

/* 侧边栏用户下拉 */
.cc-sidebar-user-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  margin-top: 8px;
}

.cc-sidebar-user.open .cc-sidebar-user-dropdown {
  max-height: 300px;
}

.cc-sidebar-user-dropdown .cc-sidebar-link {
  padding: 10px 16px;
  font-size: 13px;
}

/* 主内容区域 */
body.cc-sidebar-layout {
  display: flex;
  flex-direction: row;
}

/* 汉堡菜单按钮（移动端） */
.cc-sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1001;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(226,232,240,0.8);
  box-shadow: 0 8px 24px rgba(15,23,42,0.12);
  backdrop-filter: saturate(180%) blur(20px);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
}

.cc-sidebar-toggle:hover {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #2563eb;
  transform: scale(1.05);
}

.cc-sidebar-toggle i {
  font-size: 24px;
  color: #0f172a;
  transition: color .2s ease;
}

.cc-sidebar-toggle:hover i {
  color: #2563eb;
}

/* 遮罩层 */
.cc-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity .3s ease;
}

.cc-sidebar-overlay.show {
  opacity: 1;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  body.cc-sidebar-layout .cc-sidebar {
    transform: translateX(-100%);
  }
  
  body.cc-sidebar-layout .cc-sidebar.show {
    transform: translateX(0);
  }
  
  body.cc-sidebar-layout .cc-sidebar-toggle {
    display: flex;
  }
  
  body.cc-sidebar-layout .cc-sidebar-overlay.show {
    display: block;
  }
  
  body.cc-sidebar-layout .cc-main-wrapper {
    margin-left: 0;
    width: 100%;
  }
  
  body.cc-sidebar-layout .user-center-container,
  body.cc-sidebar-layout .container,
  body.cc-sidebar-layout main {
    padding: 80px 16px 24px;
  }
  
  body.cc-sidebar-layout .cc-footer {
    margin: 24px 16px;
  }
}

@media (max-width: 768px) {
  .cc-sidebar {
    width: 280px;
  }
  
  .cc-sidebar-logo {
    padding: 20px 16px;
  }
  
  .cc-sidebar-nav {
    padding: 12px 8px;
  }
}

/* 快捷图标区域 */
.cc-sidebar-actions {
  display: flex;
  gap: 8px;
  padding: 12px 12px 0;
  border-top: 1px solid rgba(226,232,240,0.6);
}

.cc-sidebar-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(226,232,240,0.8);
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  transition: all .2s ease;
  position: relative;
}

.cc-sidebar-action-btn:hover {
  color: #2563eb;
  border-color: #2563eb;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  transform: translateY(-2px);
}

.cc-sidebar-action-btn i {
  font-size: 20px;
}

.cc-sidebar-action-btn .cc-badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* 深色模式支持（可选） */
@media (prefers-color-scheme: dark) {
  body.cc-sidebar-layout.cc-dark-mode .cc-sidebar {
    background: rgba(15,23,42,0.95);
    border-right-color: rgba(71,85,105,0.8);
  }
  
  body.cc-sidebar-layout.cc-dark-mode .cc-sidebar-link {
    color: #cbd5e1;
  }
  
  body.cc-sidebar-layout.cc-dark-mode .cc-sidebar-link:hover {
    background: linear-gradient(135deg, rgba(37,99,235,0.2), rgba(29,78,216,0.2));
    color: #93c5fd;
  }
}
