/* 全局CSS变量 */
:root {
  --transition-speed: 0.5s;
  --transition-timing: ease-in-out;
  --primary-light: rgba(255, 255, 255, 0.9);
  --secondary-light: rgba(255, 255, 255, 0.5);
  --primary-dark: rgba(255, 255, 255, 0.9);
  --secondary-dark: rgba(150, 150, 150, 0.5);
  --accent-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --dot-size-normal: 14px;
  --dot-size-active: 18px;
  --golden-ratio: 1.618;
  --upper-section: 50vh;
  --lower-section: 50vh;
  --divider-position: 50vh;
}

/* 响应式设计：桌面端保持黄金分割比例 */
@media (min-width: 768px) {
  :root {
    --upper-section: 61.8vh;
    --lower-section: 38.2vh;
    --divider-position: 61.8vh;
  }
}

/* 添加分隔线 */
body::after {
  content: "";
  position: absolute;
  top: var(--divider-position);
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, rgba(180, 180, 180, 0.4), rgba(120, 120, 120, 0.8), rgba(180, 180, 180, 0.4));
  z-index: 25;
}

.dark body::after {
  background: linear-gradient(to right, rgba(50, 50, 50, 0.3), rgba(100, 100, 100, 0.7), rgba(50, 50, 50, 0.3));
}

/* 模型标题和版本动画效果 */
#model-title, #model-version {
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity var(--transition-speed) var(--transition-timing),
              transform var(--transition-speed) var(--transition-timing);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5),
               0 0 12px rgba(255, 255, 255, 0.353);
  padding: 0.5rem 0;
}

#model-title.active, #model-version.active {
  opacity: 1;
  transform: translateY(0);
}

/* 模型描述动画 */
#model-description {
  position: relative;
  transition: all 0.4s ease;
  opacity: 0;
  transform: translateY(10px);
}

#model-description.active {
  opacity: 1;
  transform: translateY(0);
}

/* 导航圆点样式 */
#model-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  position: absolute;
  bottom: calc(var(--lower-section) + 20px);
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  padding: 4px 12px;
  background-color: rgba(240, 240, 240, 0.7);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 30;
}

.dark #model-dots {
  background-color: rgba(40, 40, 40, 0.7);
}

.model-dot {
  width: var(--dot-size-normal);
  height: var(--dot-size-normal);
  border-radius: 50%;
  background-color: rgba(150, 150, 150, 0.5);
  border: 1px solid rgba(100, 100, 100, 0.5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-timing);
}

.model-dot:hover {
  transform: scale(1.1);
  background-color: rgba(120, 120, 120, 0.7);
  border-color: rgba(80, 80, 80, 0.8);
}

.dark .model-dot {
  background-color: var(--secondary-dark);
  border: none;
}

.dark .model-dot:hover {
  background-color: rgba(180, 180, 180, 0.7);
}

.model-dot.active {
  width: var(--dot-size-active);
  height: var(--dot-size-active);
  background-color: rgba(100, 100, 100, 0.8);
  border: 1px solid rgba(70, 70, 70, 0.9);
}

.dark .model-dot.active {
  background-color: var(--primary-dark);
  border: none;
}

/* 添加按钮悬停特效 */
button {
  backface-visibility: hidden;
  transform: translateZ(0);
  box-shadow: var(--accent-shadow);
}

/* 切换按钮样式 */
#prev-button, #next-button {
  position: absolute;
  top: var(--divider-position);
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.dark #prev-button, .dark #next-button {
  background-color: rgba(50, 50, 50, 0.7);
}

#prev-button:hover, #next-button:hover {
  transform: translateY(-50%) scale(1.15);
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.dark #prev-button:hover, .dark #next-button:hover {
  background-color: rgba(75, 75, 75, 0.9);
}

#prev-button:active, #next-button:active {
  transform: translateY(-50%) scale(0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#prev-button {
  left: 5px;
}

#next-button {
  right: 5px;
}

button:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.9);
}

.dark button:hover {
  background: rgba(75, 75, 75, 0.9);
}

/* 添加内容区域卡片效果 */
#content {
  position: absolute;
  top: var(--divider-position);
  left: 0;
  width: 100%;
  height: var(--lower-section);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  padding: 1.25rem;
  background: linear-gradient(to bottom, rgba(240, 240, 240, 0.85), rgba(245, 245, 245, 0.9));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  margin: 10px;
  border-top: 1px solid rgba(200, 200, 200, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#content:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.dark #content {
  background: linear-gradient(to bottom, rgba(30, 30, 30, 0.5), rgba(10, 10, 10, 0.7));
}

/* 模型列表项动画 */
#content ul {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  margin: 0;
  padding: 0;
}

#content ul li {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%) translateY(10px);
  left: 0;
  right: 0;
}

#content ul li.active {
  opacity: 1;
  transform: translateY(-50%);
}

/* 模型标题动画效果 */
#model-title.active {
  opacity: 1;
  transform: translateY(0);
  animation: float 6s ease-in-out infinite;
}

/* 博客文章样式 */
#model-blog {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
  max-height: 220px; /* 调整为更大的固定高度 */
  transition: max-height 0.3s ease;
}

#model-blog::-webkit-scrollbar {
  width: 6px;
}

#model-blog::-webkit-scrollbar-track {
  background: transparent;
}

#model-blog::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 3px;
}

.model-article {
  transform: translateY(0);
  transition: all 0.3s ease-in-out;
}

.model-article.hidden {
  display: none;
}

.model-article.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: fadeInUp 0.5s ease-out;
}

.model-article:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 增强标签交互感 */
.model-article .text-xs {
  transition: all 0.3s ease;
}

.model-article .text-xs:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 增强交互动画 */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

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

/* 夜间模式按钮增强 */
#night-mode-button {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#night-mode-button:hover {
  transform: scale(1.15) rotate(15deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#night-mode-button:active {
  transform: scale(0.95);
}

/* 添加图标动画 */
.fas {
  transition: transform 0.3s ease;
}

#prev-button:hover .fas {
  transform: translateX(-3px);
}

#next-button:hover .fas {
  transform: translateX(3px);
}

#night-mode-button:hover .fas {
  animation: pulse 1.5s infinite ease-in-out;
}