:root {
  --primary-color: #00d1ff;
  --text-color: #fff;
  --secondary-text: #ddd;
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-hover: rgba(255,255,255,0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #000; /* 备用背景，加载图片前 */
  background-size: cover;
  background-position: center;
  animation: fadeIn 1.5s ease-in;
  padding: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 通知栏 */
#notification {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 400px;
  background: rgba(116, 152, 236, 0.947);
  color: #fff;
  padding: 10px 20px;
  font-size: 0.9rem;
  text-align: center;
  z-index: 1000;
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  transition: top 0.6s cubic-bezier(.4,2,.6,1), opacity 0.6s;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#notification.show {
  opacity: 1;
  pointer-events: auto;
}

/* 头像 */
.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.6);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeIn 1.5s ease-in forwards;
  animation-delay: 0.5s;
}

h1 {
  font-size: 2rem;
  margin: 10px 0;
  letter-spacing: 1px;
  opacity: 0;
  animation: fadeIn 1.5s ease-in forwards;
  animation-delay: 0.8s;
  text-align: center;
}
h2 {
  font-size: 1.4rem;
  margin: 5px 0 20px 0;
  font-weight: 400;
  color: var(--secondary-text);
  opacity: 0;
  animation: fadeIn 1.5s ease-in forwards;
  animation-delay: 0.9s;
  text-align: center;
  line-height: 1.4;
}
#typewriter {
  font-size: 1rem;
  color: var(--secondary-text);
  margin-bottom: 30px;
  min-height: 1.5rem;
  opacity: 0;
  animation: fadeIn 1.5s ease-in forwards;
  animation-delay: 1.1s;
  text-align: center;
  line-height: 1.5;
  padding: 0 10px;
}

/* 链接卡片，带图标 */
.links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 40px;
}

.link-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px 10px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 600;
  transition: 0.4s ease;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* 移除正方形比例，使用自然高度 */
}

.link-card:nth-child(1) { animation-delay: 1.3s; }
.link-card:nth-child(2) { animation-delay: 1.5s; }
.link-card:nth-child(3) { animation-delay: 1.7s; }
.link-card:nth-child(4) { animation-delay: 1.9s; }
.link-card:nth-child(5) { animation-delay: 2.1s; }
.link-card:nth-child(6) { animation-delay: 2.3s; }
.link-card:nth-child(7) { animation-delay: 2.5s; }
.link-card:nth-child(8) { animation-delay: 2.7s; }
.link-card:nth-child(9) { animation-delay: 2.9s; }
.link-card:nth-child(10) { animation-delay: 3.1s; }
.link-card:nth-child(11) { animation-delay: 3.3s; }
.link-card:nth-child(12) { animation-delay: 3.5s; }

.link-card i {
  font-size: 1.6rem;
  margin-bottom: 10px;
  display: block;
  transition: color 0.3s;
}
.link-card:hover {
  background: var(--card-hover);
  transform: translateY(0) scale(1.03);
}
.link-card:hover i {
  color: var(--primary-color);
}

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

/* 社交图标 */
.socials {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 30px;
  opacity: 0;
  animation: fadeIn 1.5s ease-in forwards;
  animation-delay: 2.2s;
}

.socials a {
  color: var(--text-color);
  font-size: 1.5rem;
  transition: color 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.socials a:hover {
  color: var(--primary-color);
  transform: scale(1.2);
}

/* CNB SVG图标样式 */
.cnb-icon {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

/* 确保CNB图标为白色 */
.socials a .cnb-icon path {
  fill: currentColor !important;
}

footer {
  font-size: 0.8rem;
  color: var(--text-color);
  opacity: 0;
  animation: fadeIn 1.5s ease-in forwards;
  animation-delay: 2.6s;
  width: 100%;
  text-align: center;
  padding: 20px 0;
  margin-top: auto;
}

footer a {
  color: var(--text-color);
  text-decoration: none;
}
footer a:hover {
  color: var(--primary-color);
}

/* 手机端3列布局适配 */
@media (max-width: 767px) {
  .links {
    grid-template-columns: repeat(3, 1fr); /* 改为3列 */
    gap: 10px;
    max-width: 100%; /* 充分利用屏幕宽度 */
  }
  
  .link-card {
    padding: 12px 6px; /* 减少内边距，让内容更紧凑 */
    font-size: 0.85rem; /* 稍微减小字体以适应更多列 */
    min-height: 80px; /* 设置最小高度，避免过于扁平 */
  }
  
  .link-card i {
    font-size: 1.8rem; /* 增大图标 */
    margin-bottom: 6px;
  }
}

/* 中等手机优化 (481px-767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .links {
    gap: 12px;
  }
  
  .link-card {
    padding: 14px 8px;
    font-size: 0.9rem;
  }
  
  .link-card i {
    font-size: 2rem;
  }
}

/* 小手机优化 (≤480px) */
@media (max-width: 480px) {
  .links {
    gap: 8px;
  }
  
  .link-card {
    padding: 10px 5px;
    font-size: 0.8rem;
    min-height: 70px;
  }
  
  .link-card i {
    font-size: 1.6rem;
    margin-bottom: 4px;
  }
}

/* 超小手机优化 (≤360px) */
@media (max-width: 360px) {
  .links {
    gap: 6px;
  }
  
  .link-card {
    padding: 8px 4px;
    font-size: 0.75rem;
    min-height: 65px;
  }
  
  .link-card i {
    font-size: 1.4rem;
    margin-bottom: 3px;
  }
}

/* 平板和桌面端样式 - 保持原有布局 */
@media (min-width: 768px) {
  body {
    padding: 40px;
  }
  
  .avatar {
    width: 120px;
    height: 120px;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 1.8rem;
  }
  
  #typewriter {
    font-size: 1.1rem;
  }
  
  .links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* 保持自适应列数 */
    gap: 20px;
    width: 80%;
    max-width: 900px;
  }
  
  .link-card {
    padding: 20px 15px;
    font-size: 1.1rem;
    min-height: auto; /* 重置最小高度 */
  }
  
  .link-card i {
    font-size: 1.6rem;
    margin-bottom: 8px;
  }
  
  #notification {
    left: 24px;
    transform: none;
    width: auto;
    max-width: 90vw;
    text-align: left;
    justify-content: flex-start;
  }
  
  footer {
    position: absolute;
    bottom: 15px;
    text-align: right;
    padding-right: 20px;
    margin-top: 0;
  }
}