/* 通用样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

/* 导航栏样式 - 黑色背景 */
.header {
  background: #000;
  border-bottom: 1px solid #333;
  position: relative;
  top: 0;
  z-index: 100;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

/* Logo样式 */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.3s;
}

.logo:hover {
  opacity: 0.8;
}

.logo-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.logo span {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
}

/* 桌面端导航 */
.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-item {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
  padding: 8px 12px;
  border-radius: 4px;
}

.nav-item:hover,
.nav-item.active {
  color: #ff6b35;
  background: rgba(255, 107, 53, 0.1);
}

/* 用户信息样式 */
.user-section {
  position: relative;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.username {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.logout-btn {
  padding: 4px 12px;
  background: #ff6b35;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.logout-btn:hover {
  background: #e55a2b;
}

/* 手机端菜单按钮 */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 101;
}

.mobile-menu-btn span {
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
  display: block;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* 添加按钮点击效果 */
.mobile-menu-btn:active {
  transform: scale(0.95);
}

/* 菜单按钮悬停效果 */
@media (hover: hover) {
  .mobile-menu-btn:hover span {
    background: #ff6b35;
  }
}

/* 手机端菜单 */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #000;
  border-top: 1px solid #333;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
  z-index: 99;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* 为菜单添加微妙的渐变背景 */
.mobile-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
  z-index: -1;
}

.mobile-menu.show {
  display: block;
  max-height: 500px; /* 足够容纳所有菜单项的高度 */
  opacity: 1;
}

.mobile-nav-item {
  display: block;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid #333;
  transition: all 0.3s ease;
  transform: translateY(-10px);
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.mobile-nav-item::before {
  content: "";
  position: absolute;
  left: -100%;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
  transition: left 0.5s ease;
}

.mobile-nav-item:hover::before {
  left: 100%;
}

/* 添加菜单项的图标样式（可选） */
.mobile-nav-item.has-icon {
  padding-left: 50px;
  position: relative;
}

.mobile-nav-item.has-icon::after {
  content: "▶";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #ff6b35;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-item.has-icon:hover::after {
  opacity: 1;
}

.mobile-menu.show .mobile-nav-item {
  transform: translateY(0);
  opacity: 1;
}

/* 为每个菜单项添加延迟动画 */
.mobile-menu.show .mobile-nav-item:nth-child(1) {
  transition-delay: 0.1s;
}

.mobile-menu.show .mobile-nav-item:nth-child(2) {
  transition-delay: 0.15s;
}

.mobile-menu.show .mobile-nav-item:nth-child(3) {
  transition-delay: 0.2s;
}

.mobile-menu.show .mobile-nav-item:nth-child(4) {
  transition-delay: 0.25s;
}

.mobile-menu.show .mobile-nav-item:nth-child(5) {
  transition-delay: 0.3s;
}

.mobile-menu.show .mobile-nav-item:nth-child(6) {
  transition-delay: 0.35s;
}

.mobile-nav-item:last-child {
  border-bottom: none;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: #ff6b35;
  background: rgba(255, 107, 53, 0.1);
  padding-left: 25px;
}

.mobile-nav-item.mobile-logout-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 16px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  border-bottom: none;
}

.mobile-user-section {
  border-top: 1px solid #333;
  margin-top: 0;
  padding-top: 0;
}

.mobile-user-section .mobile-nav-item {
  background: rgba(255, 107, 53, 0.05);
}

/* 添加菜单关闭时的动画 */
.mobile-menu.closing {
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease-in-out, opacity 0.25s ease-in-out;
}

.mobile-menu.closing .mobile-nav-item {
  transform: translateY(-10px);
  opacity: 0;
  transition: all 0.2s ease-in-out;
}

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}

.breadcrumb a {
  color: #ff6b35;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .separator {
  color: #999;
}

.breadcrumb .current {
  color: #333;
  font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .profile-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
  }

  .profile-actions {
    flex-direction: row;
    justify-content: center;
  }

  .membership-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .modal-content {
    width: 95%;
    margin: 20px;
  }

  .modal-body,
  .modal-header,
  .modal-footer {
    padding: 20px;
  }

  .logo-icon {
    width: 24px;
    height: 24px;
  }

  .logo span {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .profile-avatar {
    width: 80px;
    height: 80px;
  }

  .profile-name {
    font-size: 24px;
  }

  .profile-actions {
    flex-direction: column;
  }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 其他通用样式保持不变 */
a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
textarea,
select {
  font-family: inherit;
}

/* 工具类 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 选择文本样式 */
::selection {
  background: rgba(255, 107, 53, 0.2);
  color: #333;
}

::-moz-selection {
  background: rgba(255, 107, 53, 0.2);
  color: #333;
}
