/**
 * PC Web端基础样式
 * 使用Tailwind CSS作为主要框架,此文件仅包含全局自定义样式
 */

/* 全局变量 */
:root {
  --primary-color: #4A90E2;
  --primary-color-rgb: 74, 144, 226;
  --primary-bg: #F0F7FF;
  --secondary-color: #10B981;
  --danger-color: #EF4444;
  --warning-color: #F59E0B;
  --success-color: #10B981;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
}

/* 全局字体和基础样式 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
    'Segoe UI Emoji', 'Segoe UI Symbol';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* 图片懒加载 */
img[loading='lazy'] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading='lazy'].loaded {
  opacity: 1;
}

/* 文本省略 */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 卡片悬停效果 */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 按钮禁用状态 */
button:disabled,
a.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 表单输入框焦点样式 */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

/* Toast通知样式 */
.toast {
  min-width: 300px;
  padding: 1rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  animation: slideInRight 0.3s ease-out;
}

.toast.success {
  border-left: 4px solid var(--success-color);
}

.toast.error {
  border-left: 4px solid var(--danger-color);
}

.toast.warning {
  border-left: 4px solid var(--warning-color);
}

.toast.info {
  border-left: 4px solid var(--primary-color);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 加载骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 响应式视频容器 */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 图片比例容器 */
.aspect-ratio-box {
  position: relative;
  overflow: hidden;
}

.aspect-ratio-box::before {
  content: '';
  display: block;
  padding-top: 100%; /* 默认1:1 */
}

.aspect-ratio-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 打印样式 */
@media print {
  body {
    background: white;
  }

  nav,
  footer,
  .no-print {
    display: none !important;
  }
}

/* ========================================
   首页美化样式
   ======================================== */

/* Alpine.js 隐藏未初始化元素 */
[x-cloak] { display: none !important; }

/* 浮动动画 */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(3deg); }
}

.hero-float {
  animation: float 8s ease-in-out infinite;
}

/* 脉冲点动画 */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.animate-pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* 磨砂玻璃效果 */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 统计数字字体优化 */
.stat-number {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* 渐变文字效果 */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), #10B981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 卡片悬停高级效果 */
.card-hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(74, 144, 226, 0.15);
}

/* 响应式优化 - 移动端隐藏装饰元素 */
@media (max-width: 768px) {
  .hero-float {
    display: none;
  }
}

/* 减少动画偏好支持 (无障碍) */
@media (prefers-reduced-motion: reduce) {
  .hero-float,
  .animate-pulse-dot {
    animation: none !important;
  }

  [x-transition],
  .transition-all,
  .transition-transform,
  .transition-opacity,
  .transition-colors {
    transition: none !important;
  }
}

/* ========================================
   侧边栏折叠组样式
   ======================================== */

/* 折叠组容器 */
.sidebar-collapse-group {
  margin: 0.25rem 0;
}

/* 折叠组内容区左侧指示条激活状态 */
.sidebar-collapse-group a.bg-primary {
  position: relative;
}

.sidebar-collapse-group a.bg-primary::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* ========================================
   首页美化增强样式 v2.0
   ======================================== */

/* ---------- 动画效果 ---------- */

/* 慢速旋转 - 用于装饰性边框 */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spin-slow 8s linear infinite;
}

/* 呼吸效果 */
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

.animate-breathe {
  animation: breathe 4s ease-in-out infinite;
}

/* 渐变流动效果 */
@keyframes gradient-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-flow 3s ease infinite;
}

/* 弹跳进入 */
@keyframes bounce-in {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

.animate-bounce-in {
  animation: bounce-in 0.6s ease-out;
}

/* 图标悬浮动画 */
@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.icon-bounce:hover svg {
  animation: iconBounce 0.5s ease;
}

/* ---------- 卡片效果 ---------- */

/* 卡片玻璃态 */
.card-glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* 卡片深度悬浮 */
.card-lift {
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.4s ease;
}

.card-lift:hover {
  transform: translateY(-12px);
  box-shadow:
    0 25px 50px -12px rgba(74, 144, 226, 0.2),
    0 12px 24px -8px rgba(0, 0, 0, 0.1);
}

/* 卡片边框渐变 */
.card-border-gradient {
  position: relative;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
}

.card-border-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary-color), #10B981);
  border-radius: inherit;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-border-gradient:hover::before {
  opacity: 1;
}

/* ---------- 按钮效果 ---------- */

/* 按钮点击反馈 */
.btn-press {
  transition: transform 0.1s ease;
}

.btn-press:active {
  transform: scale(0.97);
}

/* 主要按钮增强 */
.btn-primary-enhanced {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-color), #3A7BD5);
  transition: all 0.3s ease;
}

.btn-primary-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-primary-enhanced:hover::before {
  left: 100%;
}

.btn-primary-enhanced:hover {
  box-shadow: 0 8px 25px -5px rgba(74, 144, 226, 0.5);
  transform: translateY(-2px);
}

/* 聚焦状态优化 */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3);
}

.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.5);
}

/* 链接悬浮下划线动画 */
.link-underline {
  position: relative;
  text-decoration: none;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), #10B981);
  transition: width 0.3s ease;
}

.link-underline:hover::after {
  width: 100%;
}

/* ---------- 装饰元素 ---------- */

/* 区块分隔装饰 */
.section-divider {
  position: relative;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--primary-color) 20%,
    #10B981 80%,
    transparent 100%);
  border-radius: 2px;
  opacity: 0.3;
}

/* 标题装饰 */
.title-decorated {
  position: relative;
  display: inline-block;
}

.title-decorated::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), #10B981);
  border-radius: 2px;
}

/* ---------- 灯箱样式 ---------- */

/* 灯箱缩放动画 */
@keyframes lightbox-zoom {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-image {
  animation: lightbox-zoom 0.3s ease-out;
}

/* ---------- 辅助类 ---------- */

/* 快速渐变背景 */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-color), #3A7BD5);
}

.bg-gradient-success {
  background: linear-gradient(135deg, #10B981, #059669);
}

.bg-gradient-warm {
  background: linear-gradient(135deg, #F59E0B, #D97706);
}

/* 快速阴影 */
.shadow-primary-sm {
  box-shadow: 0 4px 12px -2px rgba(74, 144, 226, 0.2);
}

.shadow-primary-md {
  box-shadow: 0 8px 24px -4px rgba(74, 144, 226, 0.25);
}

.shadow-primary-lg {
  box-shadow: 0 16px 40px -8px rgba(74, 144, 226, 0.3);
}

/* ---------- 移动端优化 ---------- */

@media (max-width: 768px) {
  /* 简化动画 */
  .card-lift:hover {
    transform: translateY(-4px);
  }

  /* 优化触摸区域 */
  .touch-area {
    min-height: 48px;
    padding: 12px 16px;
  }

  /* 移动端卡片阴影 */
  .card-mobile-shadow {
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.1);
  }

  .card-mobile-shadow:active {
    box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.1);
    transform: scale(0.99);
  }
}

/* 触摸设备 */
@media (hover: none) {
  /* 移除 hover 效果，使用 active 代替 */
  .card-lift:active {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(74, 144, 226, 0.15);
  }

  /* 触摸反馈 */
  .touch-feedback:active {
    background-color: rgba(74, 144, 226, 0.1);
    transform: scale(0.98);
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .animate-spin-slow,
  .animate-breathe,
  .animate-gradient,
  .animate-bounce-in {
    animation: none !important;
  }

  .card-lift,
  .btn-primary-enhanced {
    transition: none !important;
  }
}

/* ========================================
   登录/注册页面样式
   ======================================== */

/* 认证页面背景 */
.auth-bg {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
  position: relative;
  overflow: hidden;
}

.auth-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(74, 144, 226, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.auth-bg::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* 认证卡片增强 */
.auth-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.08),
    0 20px 25px -5px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.auth-card:hover {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 25px 30px -5px rgba(0, 0, 0, 0.08);
}

/* 卡片顶部装饰线 */
.auth-card-decoration {
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), #10B981, var(--primary-color));
  background-size: 200% 100%;
  animation: gradient-flow 3s ease infinite;
  border-radius: 8px 8px 0 0;
  margin: -2rem -2rem 1.5rem -2rem;
}

/* 表单输入框增强 */
.form-input-enhanced {
  transition: all 0.2s ease;
  background-color: #f9fafb;
  border: 1.5px solid #e5e7eb;
}

.form-input-enhanced:hover {
  border-color: #d1d5db;
  background-color: #fff;
}

.form-input-enhanced:focus {
  background-color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* 验证状态 */
.form-input-enhanced.is-valid {
  border-color: var(--success-color);
  background-color: #fff;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2310B981' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.form-input-enhanced.is-valid:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input-enhanced.is-invalid {
  border-color: var(--danger-color);
  background-color: #fff;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23EF4444' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.form-input-enhanced.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 带图标的输入框 */
.input-with-icon {
  padding-left: 2.75rem !important;
}

.input-icon-left {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-wrapper:focus-within .input-icon-left {
  color: var(--primary-color);
}

/* 密码可见性切换按钮 */
.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: #6b7280;
}

/* 密码强度指示器 */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
}

.password-strength-bar {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background-color: #e5e7eb;
  transition: background-color 0.3s ease;
}

.password-strength-bar.weak { background-color: #ef4444; }
.password-strength-bar.medium { background-color: #f59e0b; }
.password-strength-bar.strong { background-color: #10b981; }

/* 表单字段入场动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-field-animate {
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
}

.form-field-animate:nth-child(1) { animation-delay: 0.05s; }
.form-field-animate:nth-child(2) { animation-delay: 0.1s; }
.form-field-animate:nth-child(3) { animation-delay: 0.15s; }
.form-field-animate:nth-child(4) { animation-delay: 0.2s; }
.form-field-animate:nth-child(5) { animation-delay: 0.25s; }
.form-field-animate:nth-child(6) { animation-delay: 0.3s; }
.form-field-animate:nth-child(7) { animation-delay: 0.35s; }

/* 错误抖动动画 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* 提交按钮增强 */
.btn-submit {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-color) 0%, #3a7bd5 100%);
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-submit:hover:not(:disabled)::before {
  left: 100%;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(74, 144, 226, 0.4);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tab 切换动效 */
.tab-content-enter {
  animation: tabFadeIn 0.25s ease-out;
}

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

/* 发送验证码按钮 */
.btn-send-code {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #374151;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-send-code:hover:not(:disabled) {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

.btn-send-code:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-send-code.counting {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: var(--primary-color);
}

/* 错误提示样式 */
.field-error {
  color: var(--danger-color);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Logo 动效 */
.logo-float {
  animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 响应式调整 */
@media (max-width: 640px) {
  .auth-card-decoration {
    margin: -1.5rem -1.5rem 1rem -1.5rem;
  }

  .auth-bg::before,
  .auth-bg::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .form-field-animate {
    animation: none;
    opacity: 1;
  }

  .logo-float {
    animation: none;
  }

  .auth-card-decoration {
    animation: none;
  }
}

/* ========================================
   导航栏特效样式
   ======================================== */

/* 导航链接下划线滑动效果 */
.nav-link-slide {
  position: relative;
}

.nav-link-slide::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link-slide:hover::after {
  width: 100%;
}

/* 激活状态的导航链接 */
.nav-link-slide.active::after {
  width: 100%;
}

/* 导航栏毛玻璃效果 - 兼容性处理 */
.navbar-glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* 不支持 backdrop-filter 的浏览器降级 */
@supports not (backdrop-filter: blur(12px)) {
  .navbar-glass {
    background: rgba(255, 255, 255, 0.95);
  }
}

/* ========================================
   聊天页面样式
   ======================================== */

/* 消息气泡 - 发送方 */
.msg-bubble-mine {
  background: linear-gradient(135deg, var(--primary-color) 0%, #3A7BD5 100%);
  color: white;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 1px 3px rgba(74, 144, 226, 0.2);
}

/* 消息气泡 - 接收方 */
.msg-bubble-other {
  background: #f3f4f6;
  color: var(--gray-900);
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 未读徽章脉冲动画 */
.unread-badge {
  animation: unread-pulse 2s ease-in-out infinite;
}

@keyframes unread-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
  }
}

/* 在线状态呼吸动画 */
.online-dot {
  animation: online-breathe 2s ease-in-out infinite;
}

@keyframes online-breathe {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0);
  }
}

/* 会话项选中状态过渡 */
.conversation-item {
  transition: all 0.2s ease;
}

.conversation-item:hover {
  background-color: var(--gray-50);
}

.conversation-item.active,
.conversation-item.bg-primary-50 {
  background-color: rgba(74, 144, 226, 0.08);
  border-left: 3px solid var(--primary-color);
}

/* 消息项进入动画 */
.msg-item {
  animation: msg-fade-in 0.3s ease-out;
}

@keyframes msg-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 日期分隔线 */
.date-separator {
  margin: 1rem 0;
}

.date-separator span {
  position: relative;
  z-index: 1;
}

/* 输入框提示 */
.chat-input-hint {
  position: absolute;
  bottom: 100%;
  left: 0;
  font-size: 0.7rem;
  color: var(--gray-400);
  margin-bottom: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chat-input:focus ~ .chat-input-hint {
  opacity: 1;
}

/* 通知引导条 */
#notification-guide {
  animation: slide-down 0.3s ease-out;
}

@keyframes slide-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 历史消息加载提示 */
#history-loader {
  animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 智能时间格式 - 今天的消息只显示时间 */
.time-today {
  font-weight: 500;
}

/* 图片消息悬停效果 */
.msg-item img {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.msg-item img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .unread-badge,
  .online-dot,
  .msg-item {
    animation: none !important;
  }

  .conversation-item,
  .msg-item img {
    transition: none !important;
  }
}

