/* ============================================================
   imlw-themes — 首页专属样式
   第一屏：（头像+花体字+渐变）
   第二屏：（视频背景+介绍文字）
   ============================================================ */

/* ---------- 首页 Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
  padding-bottom: 60px;
  position: relative;
  overflow: visible;
}

.hero .container {
  width: 100%;
}

.hero-content {
  max-width: 1000px;
  text-align: left;
  margin: 0 auto;
  padding: 0 24px;
}

/* 头像 + 呼吸灯 */
.hero-avatar {
  position: relative;
  width: 230px;
  height: 230px;
  margin: 0 auto 40px;
}

.hero-avatar .avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  border: 4px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* 深浅模式头像切换 */
.hero-avatar .avatar-light {
  display: block;
}
.hero-avatar .avatar-dark {
  display: none;
}
[data-theme="dark"] .hero-avatar .avatar-light {
  display: none;
}
[data-theme="dark"] .hero-avatar .avatar-dark {
  display: block;
}

.hero-avatar .avatar-ring {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  border: 2px solid rgba(107, 70, 193, 0.4);
  animation: avatar-breath 2.5s ease-in-out infinite;
  z-index: 1;
}

@keyframes avatar-breath {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
    box-shadow: 0 0 20px rgba(107, 70, 193, 0.3);
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
    box-shadow: 0 0 40px rgba(213, 63, 140, 0.5);
  }
}

.hero-title {
  font-family: 'Meddon', cursive;
  font-size: clamp(48px, 8vw, 80px);
  line-height: 1.2;
  color: #2d3436;
  margin: 0 0 16px 0;
  font-weight: normal;
  white-space: nowrap;
  text-align: center;
}

.hero-title .highlight {
  padding: 0 0.3em;
  background:
    linear-gradient(
      105deg,
      transparent 20%,
      rgba(255, 255, 255, 0.55) 45%,
      rgba(255, 255, 255, 0.55) 55%,
      transparent 80%
    ) 0 0/250% 100%,
    linear-gradient(90deg, #0B4ECB 0%, #016fff 50%, #7EC8E3 100%) 0 0/200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: text-shine 4s ease-in-out infinite;
}

@keyframes text-shine {
  0% {
    background-position: 250% 0, 0 50%;
  }
  100% {
    background-position: -250% 0, 100% 50%;
  }
}

@keyframes gradient-animation {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.hero-subtitle {
  font-family: 'Meddon', cursive;
  font-size: clamp(24px, 2vw, 40px);
  line-height: 1.3;
  color: #1a1a1a;
  margin: 0 0 40px 0;
  font-weight: normal;
  text-align: left;
  width: 100%;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-family: 'Meddon', cursive;
  font-size: clamp(20px, 2.5vw, 28px);
  color: #2d3436;
  text-decoration: none;
  border-bottom: 1px dashed #2d3436;
  padding-bottom: 2px;
  transition: all var(--transition);
}

.hero-cta:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hero-cta i {
  font-size: 0.7em;
  transition: transform var(--transition);
}

.hero-cta:hover i {
  transform: translateX(6px);
}

/* 暗黑模式 Hero */
[data-theme="dark"] .hero {
  background: #1a1a1a;
}

[data-theme="dark"] .hero-title {
  color: #dfe6e9;
}

[data-theme="dark"] .hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .hero-cta {
  color: #dfe6e9;
  border-bottom-color: #dfe6e9;
}

[data-theme="dark"] .hero-cta:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* ---------- 首页第二屏：左右分栏 ---------- */
.hero-video {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #ffffff;
}

.hero-video .video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 1;
  pointer-events: none;
}

.hero-video .container {
  position: relative;
  z-index: 3;
  width: 100%;
}

.hero-video-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.hero-video-text {
  flex: 0 0 48%;
  max-width: 48%;
  text-align: left;
}

.hero-video-media {
  flex: 0 0 42%;
  max-width: 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  aspect-ratio: 1 / 1;
}

.hero-video .video-bg {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  height: auto;
  max-height: 90vh;
  transform: none;
  object-fit: cover;
  z-index: 2;
  border-radius: 50%;
  box-shadow: none;
  aspect-ratio: 1 / 1;
  background: transparent;
}

/* 第二屏右侧favicon叠加（小图，不遮挡视频动画） */
.media-logo-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30%;
  max-width: 150px;
  aspect-ratio: 1 / 1;
  background: url('../images/favicon.webp') center center / contain no-repeat;
  z-index: 3;
  pointer-events: none;
}

[data-theme="dark"] .media-logo-overlay {
  background: url('../images/favicon-dark.webp') center center / contain no-repeat;
}

/* 站点名称翻书动画（已弃用，保留兼容） */
.site-name-anim {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  z-index: 2;
  pointer-events: none;
  perspective: 600px;
}

.site-name-anim .anim-char {
  position: absolute;
  top: 0;
  left: 0;
  font-size: clamp(18px, 1.8vw, 28px);
  font-weight: 700;
  color: var(--accent-hover);
  opacity: 0;
  transform: translate(-50%, -50%) scale(5) rotateY(-90deg);
  transform-style: preserve-3d;
  animation: bookFlip 35s ease-in-out infinite;
  white-space: nowrap;
  text-shadow: none;
}

.site-name-anim .anim-char:nth-child(1) { animation-delay: 0s; }
.site-name-anim .anim-char:nth-child(2) { animation-delay: -27s; }
.site-name-anim .anim-char:nth-child(3) { animation-delay: -19s; }
.site-name-anim .anim-char:nth-child(4) { animation-delay: -11s; }

@keyframes bookFlip {
  /* 每个字占22.86%（8秒），4个字共91.43%（32秒），间隔8.57%（3秒） */
  /* 翻转进入 */
  0% {
    transform: translate(-50%, -50%) scale(5) rotateY(-90deg);
    opacity: 0;
  }
  5% {
    transform: translate(-50%, -50%) scale(5) rotateY(0deg);
    opacity: 1;
  }
  /* 保持显示 */
  15% {
    transform: translate(-50%, -50%) scale(5) rotateY(0deg);
    opacity: 1;
  }
  /* 翻转离开 */
  21% {
    transform: translate(-50%, -50%) scale(5) rotateY(0deg);
    opacity: 1;
  }
  22.86% {
    transform: translate(-50%, -50%) scale(5) rotateY(90deg);
    opacity: 0;
  }
  /* 保持隐藏（等待其他字+间隔） */
  100% {
    transform: translate(-50%, -50%) scale(5) rotateY(90deg);
    opacity: 0;
  }
}

.hero-video .video-text {
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 2;
  color: #1a1a1a;
  margin: 0;
  font-weight: 400;
  letter-spacing: 1px;
}

.hero-video .video-text.video-title {
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 2px;
  color: #0B4ECB;
  text-align: left;
  line-height: 1.4;
}

.hero-video .video-text .highlight-num {
  color: #016fff;
  font-weight: 600;
  font-size: 1.15em;
}

/* 第二屏按钮 */
.hero-video .video-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding: 14px 36px;
  background: #0B4ECB;
  border: none;
  border-radius: 30px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}

.hero-video .video-btn:hover {
  background: #016fff;
  transform: translateY(-2px);
}

.hero-video .video-btn i {
  font-size: 14px;
}

/* 暗黑模式 */
[data-theme="dark"] .hero-video {
  background: #0d0d0d;
}

[data-theme="dark"] .hero-video-media .video-bg {
  display: none;
}

[data-theme="dark"] .hero-video-media {
  position: relative;
  min-height: 600px;
  background: url('../images/indexbg2.webp') center center / cover no-repeat;
  filter: drop-shadow(0 0 40px rgba(77, 159, 255, 0.4));
}

/* 浅色模式：无旋转光晕 */
.hero-video::before {
  display: none;
}

/* 去掉视频容器上的光晕，避免白圈 */
.hero-video-media::before {
  display: none;
}

/* 深色模式：视频位置显示背景图 */
[data-theme="dark"] .video-bg {
  display: none;
}

/* 深色模式：::after 做旋转光晕在背景图后面 */
[data-theme="dark"] .hero-video-media::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180%;
  height: 180%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    rgba(100, 160, 255, 0.25) 0deg,
    rgba(150, 120, 220, 0.2) 90deg,
    rgba(200, 150, 180, 0.15) 180deg,
    rgba(100, 160, 255, 0.25) 270deg,
    rgba(100, 160, 255, 0.25) 360deg
  );
  border-radius: 50%;
  filter: blur(80px);
  animation: mediaGlowRotate 22.5s linear infinite;
  z-index: 0;
  pointer-events: none;
  display: block;
}

@keyframes mediaGlowRotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* 深色模式旋转光影（整个背景，更淡） */
[data-theme="dark"] .hero-video::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150vmax;
  height: 150vmax;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    rgba(30, 80, 180, 0.15) 0deg,
    rgba(50, 120, 220, 0.2) 60deg,
    rgba(70, 150, 240, 0.25) 120deg,
    rgba(40, 100, 200, 0.18) 180deg,
    rgba(20, 60, 160, 0.15) 240deg,
    rgba(30, 80, 180, 0.15) 300deg,
    rgba(30, 80, 180, 0.15) 360deg
  );
  border-radius: 50%;
  filter: blur(80px);
  animation: heroLightRotate 60s linear infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes heroLightRotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

[data-theme="dark"] .hero-video .video-text {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .hero-video .video-text.video-title {
  color: #fff;
}

[data-theme="dark"] .hero-video .video-text .highlight-num {
  color: #4d9fff;
}

[data-theme="dark"] .site-name-anim .anim-char {
  color: #4d9fff;
  text-shadow: none;
}

/* 响应式：移动端上下排列 */
@media (max-width: 768px) {
  /* 第一屏：头像和文字缩小 */
  .hero-avatar {
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
  }

  .hero-avatar .avatar-ring {
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
  }

  .hero-title {
    font-size: clamp(32px, 8vw, 48px);
    margin-bottom: 20px;
  }

  .hero-subtitle {
    font-size: clamp(16px, 4vw, 22px);
    margin-bottom: 24px;
  }

  .hero-cta {
    font-size: clamp(14px, 3.5vw, 18px);
  }

  /* 第二屏：整体缩小 */
  .hero-video-inner {
    flex-direction: column;
    gap: 30px;
    padding: 60px 0;
  }

  .hero-video-text {
    max-width: 100%;
    text-align: center;
  }

  .hero-video-media {
    flex: none;
    width: 70%;
    max-width: 70%;
    order: -1;
    min-height: 200px !important;
    height: 200px !important;
    margin: 0 auto;
  }

  .hero-video-media::before {
    width: 100%;
    height: 100%;
  }

  .hero-video-media::after {
    width: 200%;
    height: 200%;
  }

  .media-logo-overlay {
    width: 25%;
    max-width: 60px;
  }

  .hero-video .video-text.video-title {
    text-align: center;
    font-size: clamp(20px, 5vw, 28px);
  }

  .hero-video .video-text {
    font-size: clamp(14px, 3.5vw, 18px);
    line-height: 1.8;
  }

  .hero-video .video-btn {
    display: inline-flex;
    width: fit-content;
    margin: 30px auto 0;
    padding: 10px 28px;
    font-size: 14px;
  }

  .site-name-anim .anim-char {
    font-size: clamp(14px, 3vw, 20px);
  }
}

/* ============================================================
   首页第三屏：分类栏目
   ============================================================ */
.categories-section {
  padding: 80px 0;
}

.categories-section .categories-header {
  text-align: center;
  margin-bottom: 50px;
}

.categories-section .categories-title {
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.categories-section .categories-subtitle {
  font-size: clamp(16px, 1.8vw, 18px);
  color: var(--text-secondary);
  letter-spacing: 1px;
}

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

/* 华为风格大圆角卡片 */
.categories-section .category-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 32px;
  padding: 40px 36px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.categories-section .category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
}

/* 左右分栏 */
.categories-section .category-card-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.categories-section .category-left {
  flex: 1;
  min-width: 0;
}

.categories-section .category-right {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 分类图标 */
.categories-section .category-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(11, 78, 203, 0.08), rgba(1, 111, 255, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease;
}

.categories-section .category-icon i {
  font-size: 28px;
  color: var(--accent);
}

/* 分类名称（只有名称可点击） */
.categories-section .category-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 10px 0;
}

.categories-section .category-name a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.categories-section .category-name a:hover {
  color: var(--accent);
}

/* 分类描述 */
.categories-section .category-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 18px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 胶囊标签组 */
.categories-section .category-tags {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 标签行 */
.categories-section .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 胶囊形状标签 */
.categories-section .category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--bg-input);
  font-size: 16px;
  color: var(--text-secondary);
}

.categories-section .category-tag i {
  font-size: 14px;
  color: var(--accent);
}

/* 数字加粗、颜色区分 */
.categories-section .tag-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 3px;
}

/* 深色模式 */
[data-theme="dark"] .categories-section .category-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .categories-section .category-card:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .categories-section .category-tag {
  background: var(--bg-input);
}

/* 移动端 */
@media (max-width: 768px) {
  .categories-section {
    padding: 50px 0;
  }

  .categories-section .categories-title {
    font-size: 28px;
  }

  .categories-section .categories-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .categories-section .category-card {
    padding: 28px 24px;
    border-radius: 24px;
  }

  .categories-section .category-card-inner {
    gap: 16px;
  }

  .categories-section .category-right {
    width: 60px;
    height: 60px;
  }

  .categories-section .category-icon {
    width: 54px;
    height: 54px;
  }

  .categories-section .category-icon i {
    font-size: 22px;
  }

  .categories-section .category-name {
    font-size: 18px;
  }

  .categories-section .category-tags {
    gap: 8px;
  }

  .categories-section .category-tag {
    padding: 5px 12px;
    font-size: 11px;
  }
}
