/* ============================================================
   艾斯利个人网页 · 简洁现代风
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --color-primary: #4f46e5;
  --color-primary-dark: #4338ca;
  --color-primary-soft: #eef2ff;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-text: #111827;
  --color-text-soft: #6b7280;
  --color-border: #e5e7eb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(17, 24, 39, 0.06), 0 2px 4px -2px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(17, 24, 39, 0.12);
  --container: 1120px;
  --header-h: 68px;
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
}

.skip-link:focus {
  left: 8px;
}

/* ============================================================
   顶部导航
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  color: #fff;
  font-size: 17px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: block;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-soft);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
}

.nav-toggle-bar {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ============================================================
   Hero 首屏
   ============================================================ */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 72px) 0 88px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 85% 20%, rgba(79, 70, 229, 0.12), transparent 60%),
    radial-gradient(500px 260px at 10% 75%, rgba(124, 58, 237, 0.10), transparent 60%),
    linear-gradient(180deg, #fafaff 0%, #ffffff 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
  max-width: 760px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
}

.gradient-text {
  background: linear-gradient(120deg, var(--color-primary), #7c3aed 60%, #db2777);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-subtitle {
  margin: 20px auto 32px;
  max-width: 560px;
  font-size: 17px;
  color: var(--color-text-soft);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 56px;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stats strong {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-text);
}

.hero-stats span {
  font-size: 13px;
  color: var(--color-text-soft);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.5);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-small {
  padding: 8px 18px;
  font-size: 14px;
}

/* ============================================================
   通用区块
   ============================================================ */
.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section-tag {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.section-desc {
  font-size: 16px;
  color: var(--color-text-soft);
}

.section-more {
  text-align: center;
  margin-top: 48px;
}

/* ============================================================
   项目卡片
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card-cover {
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-emoji {
  font-size: 52px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.cover-1 { background: linear-gradient(135deg, #dbeafe, #ede9fe); }
.cover-2 { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.cover-3 { background: linear-gradient(135deg, #dcfce7, #a7f3d0); }
.cover-4 { background: linear-gradient(135deg, #ffe4e6, #fecdd3); }
.cover-5 { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); }
.cover-6 { background: linear-gradient(135deg, #d1fae5, #99f6e4); }

/* 上传图片作为封面时：填满封面区域、等比裁切 */
.card-cover.cover-img,
.video-cover.cover-img {
  overflow: hidden;
  padding: 0;
}
.card-cover.cover-img img,
.video-cover.cover-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 22px 24px 24px;
}

.card-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.card-title a {
  transition: color 0.2s ease;
}

.card-title a:hover {
  color: var(--color-primary);
}

.card-text {
  font-size: 14.5px;
  color: var(--color-text-soft);
  margin-bottom: 14px;
}

.card-meta {
  font-size: 12.5px;
  color: #9ca3af;
}

/* ============================================================
   课程
   ============================================================ */
.course-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 860px;
  margin: 0 auto;
}

.course {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.course-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--color-primary-soft);
  border-radius: 14px;
}

.course-info {
  flex: 1;
  min-width: 0;
}

.course-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.course-text {
  font-size: 14.5px;
  color: var(--color-text-soft);
}

.course-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.course-tag {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  padding: 4px 12px;
  border-radius: 999px;
}

/* ============================================================
   旅拍视频
   ============================================================ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.video-card {
  text-align: left;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.video-cover {
  position: relative;
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  transition: background 0.3s ease;
}

.video-card:hover .video-cover::before {
  background: rgba(17, 24, 39, 0.2);
}

.cover-v1 { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.cover-v2 { background: linear-gradient(135deg, #b45309, #f59e0b); }
.cover-v3 { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.cover-v4 { background: linear-gradient(135deg, #374151, #6b7280); }

.video-play {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  backdrop-filter: blur(4px);
  padding-left: 3px;
  transition: transform 0.3s ease, background 0.3s ease;
}

.video-card:hover .video-play {
  transform: scale(1.12);
  background: rgba(255, 255, 255, 0.35);
}

.video-info {
  padding: 16px 18px 18px;
}

.video-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.video-meta {
  font-size: 13px;
  color: var(--color-text-soft);
}

/* ============================================================
   关于我
   ============================================================ */
.about-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: center;
  max-width: 900px;
}

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

.about-avatar {
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.about-avatar.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-text {
  font-size: 16px;
  color: var(--color-text-soft);
  margin: 16px 0 24px;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.about-tags li {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  border-radius: 999px;
}

.about-contact {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-inner p {
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #fff;
}

/* ============================================================
   视频弹窗
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  animation: fade-in 0.25s ease;
}

.modal-panel {
  position: relative;
  width: min(900px, 100%);
  background: #0f172a;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
  animation: zoom-in 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.32);
}

.modal-video {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.modal-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.modal-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 48px;
  color: #cbd5e1;
  font-size: 16px;
  text-align: center;
  line-height: 2;
}

.modal-placeholder code {
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 14px;
}

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

@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   滚动显现动画
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-bg,
  .btn,
  .card,
  .course,
  .video-card,
  .modal-panel,
  .modal-backdrop {
    animation: none;
    transition: none;
  }
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 60px;
  }

  .section {
    padding: 72px 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 20px 20px;
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    padding: 12px 14px;
    font-size: 16px;
  }

  .hero {
    padding: calc(var(--header-h) + 56px) 0 72px;
  }

  .hero-stats {
    gap: 32px;
  }

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

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

  .course {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .course-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }

  .about-tags,
  .about-contact {
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-stats {
    gap: 20px;
  }
  .hero-stats strong {
    font-size: 22px;
  }
  .hero-actions .btn {
    width: 100%;
  }
}
