/* ==========================================
   个人网站 - 样式表
   ========================================== */

/* ---------- 基础重置和全局样式 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  text-decoration: none;
  color: #555;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #4f46e5;
}

/* ---------- 首页 Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
  padding-top: 64px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #1a1a2e;
}

.hero .highlight {
  color: #4f46e5;
}

.hero .subtitle {
  font-size: 22px;
  color: #666;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.hero .intro {
  font-size: 17px;
  color: #888;
  max-width: 500px;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-primary {
  background: #4f46e5;
  color: #fff;
}

.btn-primary:hover {
  background: #4338ca;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-outline {
  border: 2px solid #4f46e5;
  color: #4f46e5;
}

.btn-outline:hover {
  background: #4f46e5;
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- 通用板块标题 ---------- */
.section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  color: #1a1a2e;
  margin-bottom: 48px;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: #4f46e5;
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ---------- 关于我 ---------- */
.about {
  padding: 100px 0;
}

.about-content {
  display: flex;
  justify-content: center;
}

.about-text {
  max-width: 700px;
}

.about-text p {
  font-size: 16px;
  color: #555;
  margin-bottom: 20px;
  text-indent: 2em;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.info-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: #f8f9fc;
  border-radius: 8px;
}

.info-label {
  font-weight: 600;
  color: #888;
  min-width: 48px;
}

.info-value {
  color: #333;
}

/* ---------- 技能 ---------- */
.skills {
  padding: 100px 0;
  background: #f8f9fc;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
}

.skill-card {
  background: #fff;
  padding: 32px 24px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s, box-shadow 0.25s;
}

.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.skill-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.skill-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #1a1a2e;
}

.skill-card p {
  font-size: 14px;
  color: #777;
  line-height: 1.5;
}

/* ---------- 项目 ---------- */
.projects {
  padding: 100px 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.project-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s, box-shadow 0.25s;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.project-card:nth-child(1)::before,
.project-card:nth-child(2)::before {
  content: "";
  display: block;
  height: 160px;
}

.project-card:nth-child(1)::before {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.project-card:nth-child(2)::before {
  background: linear-gradient(135deg, #059669, #10b981);
}

.project-image-wrapper {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #2d2d44, #1e1e30);
  border-radius: 12px 12px 0 0;
  position: relative;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

.project-info {
  padding: 24px;
}

.project-title {
  display: inline-block;
  font-size: 19px;
  margin-bottom: 8px;
  color: #1a1a2e;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.project-title:hover {
  color: #4f46e5;
}

.project-info p {
  font-size: 14px;
  color: #777;
  margin-bottom: 16px;
}

.project-link {
  display: inline-block;
  padding: 8px 18px;
  margin-top: 16px;
  background: #4f46e5;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.project-link:hover {
  background: #4338ca;
  transform: translateY(-2px);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  background: #eef2ff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ---------- 友情链接 ---------- */
.friends {
  padding: 100px 0;
  background:
    radial-gradient(1000px 500px at 50% 0%, rgba(79, 70, 229, 0.05), transparent 70%),
    #fff;
}

.friends-desc {
  text-align: center;
  font-size: 16px;
  color: #888;
  margin-top: -32px;
  margin-bottom: 48px;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.friend-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 24px;
  background: #fff;
  border: 1px solid #eef0f5;
  border-radius: 20px;
  text-decoration: none;
  color: #333;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
  overflow: hidden;
}

/* 卡片顶部装饰线 */
.friend-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #4f46e5, transparent);
  border-radius: 0 0 3px 3px;
  opacity: 0;
  transition: opacity 0.35s, left 0.35s, right 0.35s;
}

.friend-card:hover {
  transform: translateY(-8px);
  border-color: #c7d2fe;
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.13);
}

.friend-card:hover::before {
  opacity: 1;
  left: 12%;
  right: 12%;
}

/* ---- 头像区 ---- */
.friend-avatar {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.12);
  transition: border-radius 0.35s, box-shadow 0.35s;
}

.friend-card:hover .friend-avatar {
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.22);
}

.friend-avatar-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  z-index: 1;
}

/* fallback 时显示首字母 */
.friend-avatar-letter {
  display: none;
  position: absolute;
  font-size: 30px;
  font-weight: 700;
  color: #4f46e5;
  z-index: 0;
}

.friend-avatar.fallback .friend-avatar-letter {
  display: block;
}

/* ---- 正文区 ---- */
.friend-body {
  text-align: center;
  margin-bottom: 16px;
}

.friend-name {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 6px;
  /* 超出两行省略 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.friend-desc {
  font-size: 13px;
  color: #999;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- 域名标签 ---- */
.friend-domain {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  background: #f3f4f6;
  padding: 4px 12px;
  border-radius: 999px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.35s, color 0.35s;
}

.friend-card:hover .friend-domain {
  background: #eef2ff;
  color: #4f46e5;
}

/* ---------- 联系 ---------- */
.contact {
  padding: 100px 0;
  background: #f8f9fc;
  text-align: center;
}

.contact-desc {
  font-size: 16px;
  color: #666;
  margin-bottom: 32px;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: #fff;
  border-radius: 10px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s, box-shadow 0.25s;
}

.contact-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.contact-icon {
  font-size: 20px;
}

/* ---------- 页脚 ---------- */
.footer {
  padding: 28px 0;
  text-align: center;
  background: #1a1a2e;
  color: #aaa;
  font-size: 14px;
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 34px;
  }

  .hero .subtitle {
    font-size: 18px;
  }

  .nav-links {
    display: none;
  }

  .section-title {
    font-size: 26px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}