/* 自定义样式补充 */

/* Alpine.js 初始化前隐藏带 x-cloak 的元素，避免闪烁 */
[x-cloak] {
  display: none !important;
}

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 链接默认样式 */
a {
  transition: color 0.2s;
}

/* 富文本内容样式 */
.rich-text-content h1 {
  font-size: 1.875rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
  color: #0f172a;
}

.rich-text-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
  color: #0f172a;
}

.rich-text-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem;
  color: #1e293b;
}

.rich-text-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: #334155;
}

.rich-text-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

.rich-text-content ul,
.rich-text-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.rich-text-content ul li {
  list-style: disc;
  margin-bottom: 0.5rem;
}

.rich-text-content ol li {
  list-style: decimal;
  margin-bottom: 0.5rem;
}

.rich-text-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.rich-text-content table th,
.rich-text-content table td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.rich-text-content table th {
  background: #f8fafc;
  font-weight: 600;
}

.rich-text-content blockquote {
  border-left: 4px solid #2563eb;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: #f8fafc;
  color: #475569;
}

.rich-text-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
}

.rich-text-content code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
}

.rich-text-content pre code {
  background: none;
  padding: 0;
}

/* 数字动画 */
@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-count-up {
  animation: count-up 0.6s ease-out;
}

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

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.1);
}

/* 渐变背景 */
.gradient-primary {
  background: linear-gradient(135deg, #2563eb 0%, #0d9488 100%);
}

.gradient-accent {
  background: linear-gradient(135deg, #f59e0b 0%, #2563eb 100%);
}

/* 文字截断 */
.text-ellipsis-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

/* ============ 导航栏 Logo 与菜单跳动 & 阴影效果 ============ */

/* Logo 悬停跳动动画 */
.nav-logo {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.3s ease;
  will-change: transform;
}

.nav-logo:hover {
  animation: nav-logo-bounce 0.6s ease infinite;
  filter: drop-shadow(0 6px 12px rgba(37, 99, 235, 0.35));
}

@keyframes nav-logo-bounce {
  0%, 100% { transform: translateY(0); }
  30%      { transform: translateY(-8px); }
  50%      { transform: translateY(0); }
  70%      { transform: translateY(-4px); }
}

/* 菜单项跳动动画 */
.nav-link {
  position: relative;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              color 0.2s ease,
              background-color 0.2s ease;
  will-change: transform;
}

.nav-link:hover {
  animation: nav-link-bounce 0.6s ease infinite;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  transform: translateY(-2px);
}

@keyframes nav-link-bounce {
  0%, 100% { transform: translateY(0); }
  30%      { transform: translateY(-6px); }
  50%      { transform: translateY(0); }
  70%      { transform: translateY(-3px); }
}

/* 移动端菜单项同样使用跳动效果 */
.mobile-nav-link {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              color 0.2s ease,
              background-color 0.2s ease;
  will-change: transform;
}

.mobile-nav-link:hover {
  animation: nav-link-bounce 0.6s ease infinite;
}

/* 尊重系统减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .nav-logo:hover,
  .nav-link:hover,
  .mobile-nav-link:hover {
    animation: none;
  }
}

/* ============ 阿凡达星球 菜单（蓝青渐变动态字体） ============ */
.nav-link-avatar {
  font-weight: 700;
  background: linear-gradient(90deg, #2563eb, #00e5ff, #0d9488, #2563eb);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: avatar-gradient-shift 4s linear infinite;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.35));
}

.nav-link-avatar:hover {
  animation: avatar-gradient-shift 2s linear infinite;
  filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.6));
}

@keyframes avatar-gradient-shift {
  0%   { background-position: 0% center; }
  100% { background-position: 300% center; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-link-avatar {
    animation: none;
    background: linear-gradient(90deg, #2563eb, #0d9488);
  }
}
