/* ========== 统一导航栏 ========== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 5%;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(255,182,193,0.15);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 30px;
}

.logo {
  font-size: 1.3rem;
  font-weight: bold;
  color: #ff6b9d;
  text-decoration: none;
  text-shadow: 0 2px 4px rgba(255,107,157,0.15);
}

.nav-links {
  display: flex;
  gap: 22px;
}

.nav-links a {
  text-decoration: none;
  color: #666;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s;
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover, .nav-links a.active {
  color: #ff6b9d;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, #ff6b9d, #ff8fab);
  transition: width 0.3s;
  border-radius: 2px;
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

/* ========== 用户区域 ========== */
.login-btn {
  padding: 8px 18px;
  background: linear-gradient(135deg, #ff6b9d, #ff8fab);
  color: white;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(255,107,157,0.25);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255,107,157,0.35);
}

.user-menu {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 24px;
  transition: all 0.3s;
  background: rgba(255, 240, 245, 0.6);
  border: 1px solid transparent;
}

.user-trigger:hover {
  background: rgba(255, 240, 245, 1);
  border-color: #ffd6e0;
}

.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffd6e0;
  background: #fff0f5;
}

.nav-avatar-fallback {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #ff8fab);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-username {
  color: #555;
  font-weight: 600;
  font-size: 0.9rem;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-arrow {
  font-size: 0.7rem;
  color: #aaa;
  transition: transform 0.3s;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 8px 0;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s;
  z-index: 200;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown a {
  display: block;
  padding: 10px 18px;
  color: #555;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.user-dropdown a:hover {
  background: #fff8fa;
  color: #ff6b9d;
}

.dropdown-divider {
  height: 1px;
  background: #ffe4e1;
  margin: 6px 12px;
}

.logout-link {
  color: #ff6b9d !important;
  cursor: pointer;
}

@media (max-width: 640px) {
  .navbar { padding: 12px 3%; }
  .nav-left { gap: 15px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.85rem; }
  .nav-username { display: none; }
}

/* ========== 统一字体 ========== */
body, input, textarea, button {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* 页面标题统一 */
.page-header h1 {
  font-family: inherit;
  font-weight: 700;
}

/* 卡片标题统一 */
h2, h3 {
  font-family: inherit;
  font-weight: 600;
}

/* ========== 消息 & 通知系统 ========== */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255, 240, 245, 0.6);
}

.nav-icon-btn:hover {
  background: rgba(255, 240, 245, 1);
  transform: translateY(-1px);
}

.nav-icon {
  font-size: 1.3rem;
  filter: grayscale(0.2);
}

.notify-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ff4757;
  color: white;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(255, 71, 87, 0.3);
  animation: pulse 2s infinite;
}

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

/* 下拉菜单 */
.notify-dropdown, .chat-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s;
  z-index: 200;
}

.notify-dropdown.show, .chat-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notify-header, .chat-header {
  padding: 14px 18px;
  font-weight: 700;
  color: #555;
  font-size: 1rem;
  border-bottom: 1px solid #f5f5f5;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

/* 通知项 */
.notify-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #fafafa;
  transition: background 0.2s;
}

.notify-item:hover {
  background: #fff8fa;
}

.notify-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #ff8fab);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.notify-content {
  flex: 1;
}

.notify-title {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.4;
  margin-bottom: 8px;
}

.notify-actions {
  display: flex;
  gap: 8px;
}

.btn-accept {
  padding: 6px 16px;
  background: #6bcb77;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-reject {
  padding: 6px 16px;
  background: #f0f0f0;
  color: #888;
  border: none;
  border-radius: 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* 聊天列表项 */
.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #fafafa;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-item:hover {
  background: #fff8fa;
}

.chat-item-avatar, .chat-item-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.chat-item-avatar-fallback {
  background: linear-gradient(135deg, #ff6b9d, #ff8fab);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
}

.chat-item-info {
  flex: 1;
  min-width: 0;
}

.chat-item-name {
  font-weight: 600;
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.chat-item-preview {
  color: #aaa;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notify-empty, .chat-empty {
  text-align: center;
  padding: 40px 20px;
  color: #bbb;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .notify-dropdown, .chat-dropdown {
    width: 280px;
    right: -60px;
  }
}

/* ===== 可爱加载动画 ===== */
.loading-cute {
  text-align: center;
  padding: 50px 20px;
  color: #ff8fa3;
  font-size: 0.9rem;
}

.loading-cute .dots {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 12px;
  align-items: center;
  justify-content: center;
}

.loading-cute .dots span {
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #ff8fa3, #ffc2d1);
  border-radius: 50%;
  display: inline-block;
  animation: dotBounce 1.4s ease-in-out infinite both;
}

.loading-cute .dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-cute .dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-cute .dots span:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

.loading-cute .text {
  color: #ff8fa3;
  font-size: 0.85rem;
  letter-spacing: 2px;
  animation: textFade 1.5s ease-in-out infinite;
}

@keyframes textFade {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.loading-cute .heart-spin {
  font-size: 2rem;
  margin-bottom: 10px;
  display: inline-block;
  animation: heartSpin 1.5s ease-in-out infinite;
}

@keyframes heartSpin {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(10deg) scale(1.2); }
  50% { transform: rotate(0deg) scale(1); }
  75% { transform: rotate(-10deg) scale(1.2); }
  100% { transform: rotate(0deg) scale(1); }
}

/* 页面切换淡入 */
.page-fade-in {
  animation: fadeIn 0.5s ease-out;
}

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