/* 
  owo-story - 100% Exact 3D Inward Corner Theme
  Created by Antigravity (MikaKa) for Lambda
*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  font-family: 'Outfit', 'Noto Sans SC', sans-serif;
  /* 背景白色地板 */
  background-color: #ffffff;
  color: #222222;
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
}

a {
  color: #0099ff;
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: #0077cc;
}

/* 1. 3D 内凹墙角架构 /|\ (固定背景) */
.room-3d-corner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* 右墙正面 (灰色梯形) */
/* 交点在中轴线 X=20vw, Y=30vh 处。向右下方延伸 \ */
.right-wall-front {
  position: absolute;
  top: 0;
  left: 20vw;
  width: 80vw;
  height: 50vh;
  background: #e2e6ea;
  /* 顶点坐标：左上(0,0)，右上(100%,0)，右下(100%, 100% -> 50vh)，左中(0, 60% -> 30vh) */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 60%);
}

.whale-bg-container {
  position: absolute;
  top: 5vh;
  right: 5vw;
  width: 50vw;
  height: 35vh;
  background: url('../images/bg-whale.svg') no-repeat right center;
  background-size: contain;
}

/* 左墙正面 (灰色平行四边形) */
/* 从交点 (X=20vw, Y=30vh) 向左下方延伸 / */
.left-wall-front {
  position: absolute;
  top: 0;
  left: 0;
  width: 20vw;
  height: 50vh;
  background: #dce1e6;
  /* 稍微深一点增加折角立体感 */
  /* 右上(100%, 0), 右下(100%, 60% -> 30vh), 左下(0, 100% -> 50vh), 左上(0, 40% -> 20vh) */
  clip-path: polygon(100% 0, 100% 60%, 0 100%, 0 40%);
}

/* 左墙顶部 (蓝色三角形) */
/* 完美衔接在左墙正面的上方，构成完整的 3D 墙壁厚度 */
.left-wall-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 20vw;
  height: 20vh;
  /* 正好衔接到左墙正面的左上角 20vh 处 */
  background: #0099ff;
  /* 蓝色的 ◤ 三角形: 左上(0,0), 右上(100%, 0), 左下(0, 100%) */
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* 2. 等距透视内容容器 */
.isometric-container {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* 3. 左侧导航区域 (在左边 20vw 的区域内) */
.sidebar-wall {
  width: 20vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* 垂直居中 */
  align-items: flex-end;
  /* 未选中的靠右排列 */
  padding-right: 2vw;
  /* 距离中线一点距离 */
  z-index: 10;
  /* 确保不被右侧文章区域遮挡 */
}

/* 右墙面上的 Logo (在鲸鱼的左侧) */
.site-title-container {
  position: absolute;
  top: 10vh;
  /* 与导航差不多高度 */
  left: 2vw;
  /* 距离右墙的左边缘 */
  z-index: 10;
  /* 文字透视，与右侧墙面底边 \ 的倾斜度一致 */
  /* 右墙底边 slope: dy=20vh, dx=80vw. 约 8度角 */
  transform: rotate(8deg) skewX(-15deg);
  transform-origin: left top;
}

.site-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1a1a1a;
  display: flex;
  align-items: baseline;
  letter-spacing: -1px;
}

.title-miao {
  color: #222222;
}

.title-zhai {
  color: #0099ff;
  font-size: 4.0rem;
  margin: 0 4px;
}

.title-houyuan {
  color: #333333;
}

/* 阶梯导航菜单 */
.nav-menu {
  position: relative;
  width: 100%;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  /* 整体靠右 */
  width: 100%;
}

.nav-item {
  position: relative;
  margin-bottom: 2.5rem;
}

/* ----------------未选中状态 (排在右侧，无修饰)---------------- */
.nav-item:not(.active) {
  margin-right: 2vw;
  /* 右侧留一点空隙 */
  transition: transform 0.3s ease;
}

.nav-item:not(.active):hover {
  transform: translateX(-10px);
}



.nav-item:not(.active) .nav-link {
  font-size: 2.5rem;
  font-weight: 900;
  color: #000000;
  display: inline-block;
  padding: 0;
}

.nav-item:not(.active) .nav-link:hover {
  color: #0099ff;
}

/* ----------------选中状态 (居左变大，完整 SVG 3D 楔形底座)---------------- */
@keyframes slideIn3D {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav-item.active {
  align-self: flex-start;
  /* 靠左排列 */
  width: 250px;
  height: 150px;
  margin-left: 2vw;
  /* 左侧留一点空隙 */
  animation: slideIn3D 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.nav-3d-wedge-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  /* 在文字下方 */
}

.nav-item.active .nav-link {
  position: absolute;
  top: 25px;
  /* 放在蓝色三角形内部 */
  left: 25px;
  color: #000000;
  /* 设计图黑字 */
  font-size: 3.2rem;
  font-weight: 900;
  padding: 0;
  display: inline-block;
  z-index: 2;
  /* 确保文字在 SVG 上方 */
}

.nav-item.active .nav-link::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  color: #ffffff;
  z-index: 3;
  pointer-events: none;
  /* 精确匹配蓝色三角形的边界：
     顶点 A(10, 20)  -> 相对于文字(-15px, -5px)
     顶点 B(10, 110) -> 相对于文字(-15px, 85px)
     顶点 C(180, 110)-> 相对于文字(155px, 85px) */
  clip-path: polygon(-15px -5px, -15px 85px, 155px 85px);
}

/* 4. 右侧文章区域 */
.main-content {
  flex: 1;
  margin-left: 20vw;
  /* 距离顶部一段距离，让卡片悬浮在右墙的下方边界处交错 */
  padding: 30vh 5vw 10vh 5vw;
  position: relative;
  z-index: 5;
}

.content-container {
  width: 100%;
  max-width: 850px;
}

/* 5. 3D 玻璃展柜卡片 */
.post-list {
  display: flex;
  flex-direction: column;
}

.post-card {
  position: relative;
  /* 完全透明，去除模糊，仅靠高光表现镜面材质 */
  background-color: transparent;
  padding: 2rem;
  margin-bottom: 4rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-left: 20px;
}

/* 锐利的镜面反光条纹 */
.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* 带有陡峭边缘的锐利线性渐变，模拟镜面反光 */
  background: linear-gradient(105deg,
      transparent 0%,
      transparent 30%,
      rgba(255, 255, 255, 0.05) 30%,
      rgba(255, 255, 255, 0.3) 35%,
      rgba(255, 255, 255, 0) 35.1%,
      /* 锐利边缘突变 */
      transparent 37%,
      rgba(255, 255, 255, 0.05) 37.1%,
      /* 锐利边缘突变 */
      rgba(255, 255, 255, 0.15) 39%,
      rgba(255, 255, 255, 0) 39.1%,
      /* 锐利边缘突变 */
      transparent 100%);
  z-index: 1;
  /* 在文字（z-index: 2）下方 */
  pointer-events: none;
}

/* 用伪元素绘制玻璃边框，z-index: 1 确保它在桌面梯形上方 */
.post-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 3px solid #0099ff;
  z-index: 1;
  pointer-events: none;
  /* 穿透点击 */
}

.post-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 15px 15px 0 rgba(0, 153, 255, 0.08);
}

.post-card:nth-child(odd) {
  margin-left: 0;
}

.post-card:nth-child(even) {
  margin-left: 5vw;
}

/* 玻璃展柜内部的白色地板！ */
/* 右墙底边是向右下 \ 倾斜的，所以这里的地板顶边必须向右下倾斜！ */
/* 使用 transform: skewY(正角度) 可以完美产生向右下的斜面 */
.card-floor {
  position: absolute;
  /* 恢复自由多边形，扩展容器以绘制超出边界的形状 */
  top: 0;
  bottom: -30px;
  left: -100px;
  right: -200px;
  background: #f0f2f5;
  /* 灰色梯形桌面 */
  /*
    使用距底部的固定高度，避免过长文章拉伸：
    假定桌面深度 (高度) 为 160px。
    Top-Left Y = calc(100% - 160px)
    Top-Right Y 下沉 50px = calc(100% - 110px)
  */
  clip-path: polygon(60px 100%,
      300px calc(100% - 160px),
      calc(100% - 120px) calc(100% - 110px),
      calc(100% - 160px) 100%);
  z-index: 0;
}

/* 玻璃反光线 */
.glass-reflection {
  position: absolute;
  top: 15px;
  right: 25px;
  width: 60px;
  height: 60px;
  z-index: 2;
  /* 确保在边框和桌面之上 */
  pointer-events: none;
}

.glass-reflection::before,
.glass-reflection::after {
  content: '';
  position: absolute;
  background-color: #0099ff;
  border-radius: 2px;
  transform: rotate(-40deg);
  /* 倾斜角度稍微平缓一点 */
}

/* 左侧长反光线 */
.glass-reflection::before {
  top: 0;
  right: 25px;
  width: 4px;
  height: 40px;
}

/* 右侧短反光线 */
.glass-reflection::after {
  top: 15px;
  right: 5px;
  width: 4px;
  height: 20px;
}

/* 6. 文章内容排版 */
.post-card-body {
  position: relative;
  z-index: 2;
}

.post-card-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.post-card-title a {
  color: #111111;
}

.post-card-title a:hover {
  color: #0099ff;
}

.post-card-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 2rem;
}

.post-card-meta i {
  color: #0099ff;
  margin-right: 5px;
}

.post-card-meta a {
  color: #666;
}

.post-card-excerpt,
.post-card-desc {
  font-size: 1.05rem;
  color: #444;
  line-height: 1.8;
  margin-bottom: 2rem;
  text-align: justify;
}

/* 限制首页文章卡片的高度，并隐藏溢出，防止图片和长文撑爆卡片 */
.post-card-excerpt {
  max-height: 150px;
  overflow: hidden;
  position: relative;
}

/* 限制卡片内的图片最大宽度，防止横向溢出 */
.post-card-excerpt img,
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.read-more {
  font-weight: 800;
  color: #0099ff;
}

.read-more-arrow {
  display: inline-block;
  transition: transform 0.2s;
}

.read-more:hover .read-more-arrow {
  transform: translateX(5px);
}

/* Markdown 页面 */
.post-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.post-content {
  font-size: 1.1rem;
  color: #333;
  line-height: 1.8;
}

.post-content h2 {
  font-size: 1.8rem;
  margin: 2.5rem 0 1.2rem;
  border-left: 5px solid #0099ff;
  padding-left: 15px;
}

.post-content img {
  max-width: 100%;
  border: 2px solid #0099ff;
  margin: 1.5rem 0;
}

.post-content pre,
.post-content .highlight {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 153, 255, 0.3);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  max-width: 100%;
}

.post-content .highlight table {
  margin: 0;
  width: auto;
  border: none;
}

.post-content .highlight td {
  border: none;
  padding: 0;
}

.post-content .highlight .gutter {
  user-select: none;
  padding-right: 15px;
  border-right: 1px solid rgba(0, 153, 255, 0.2);
  color: #999;
  text-align: right;
}

.post-content .highlight .code {
  padding-left: 15px;
}

.post-content .highlight pre {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  overflow: visible;
}

/* 归档分页 */
.archive-title {
  font-size: 2.2rem;
  margin-bottom: 2rem;
}

.archive-year {
  font-size: 1.6rem;
  margin: 2rem 0 1rem;
  color: #0099ff;
  font-weight: 700;
}

.archive-item {
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
}

.archive-date {
  font-size: 0.95rem;
  color: #666;
  margin-right: 1.5rem;
}

.archive-post-title {
  font-size: 1.1rem;
  color: #222;
  font-weight: 600;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 4rem;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  border: 2px solid #0099ff;
  color: #0099ff;
  font-weight: 700;
}

.pagination span.current {
  background: #0099ff;
  color: white;
}

.footer {
  padding: 3rem 0;
  text-align: center; /* 居中对齐 */
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center; /* 居中 */
  justify-content: center;
}

/* 第一行：带蓝色边框直角矩形 */
.footer-btn-container {
  margin-bottom: 0.8rem;
}

.footer-btn-rect {
  display: inline-block;
  padding: 0.4rem 1.4rem;
  border: 2px solid #0099ff;
  color: #0099ff;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.25s ease;
  background-color: transparent;
  border-radius: 0; /* 纯直角 */
  box-shadow: 3px 3px 0 rgba(0, 153, 255, 0.1);
}

.footer-btn-rect:hover {
  background-color: #0099ff;
  color: #ffffff;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(0, 153, 255, 0.15);
}

/* 第二行：喵宅苑 */
.footer-miao-link {
  margin-bottom: 0.4rem;
}

.footer-miao-link a {
  color: #777777;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-miao-link a:hover {
  color: #0099ff;
}

/* 第三行：自豪地使用 Hexo 构建 */
.footer-proud {
  color: #999999;
  font-size: 0.8rem;
  font-weight: 400;
}

/* 7. 文章头部多图九宫格组件 */
.post-card-thumbs {
  display: grid;
  gap: 8px;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  max-width: 320px; /* PC 端限制宽度，不撑满 */
}

/* 根据图片数量动态调整布局列数 */
.post-card-thumbs.grid-1 {
  grid-template-columns: 1fr;
}
.post-card-thumbs.grid-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 210px;
}
.post-card-thumbs.grid-4 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 210px;
}
.post-card-thumbs.grid-3,
.post-card-thumbs.grid-5,
.post-card-thumbs.grid-6,
.post-card-thumbs.grid-7,
.post-card-thumbs.grid-8,
.post-card-thumbs.grid-9 {
  grid-template-columns: repeat(3, 1fr);
}

/* 3D 玻璃风格缩略图 */
.post-thumb-item {
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 2px solid #0099ff;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 3px 3px 0 rgba(0, 153, 255, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* 1张图时适中的尺寸 */
.post-card-thumbs.grid-1 .post-thumb-item {
  width: 150px;
  height: 150px;
}

.post-thumb-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(0, 153, 255, 0.15);
}

.post-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================
   响应式设计与交互
========================================= */

/* 移动端菜单按钮 (默认隐藏，仅手机端显示) */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 15px;
  margin-top: 15px;
}

.hamburger-line {
  width: 30px;
  height: 4px;
  background: #0099ff;
  border-radius: 2px;
}

.bottom-nav {
  display: none;
}

@media screen and (max-width: 768px) {
  .isometric-container {
    flex-direction: column;
    /* 手机端改回垂直排列 */
  }

  /* 隐藏左侧侧边栏和按钮 */
  .sidebar-wall,
  .mobile-menu-btn {
    display: none !important;
  }

  /* 3D 墙角适配：隐藏左墙，保留并铺满整个屏幕宽度 */
  .left-wall-front,
  .left-wall-top {
    display: none;
  }

  .right-wall-front {
    left: 0;
    width: 100%;
    /* 恢复墙壁底部的正确高度，防止内部元素被过度裁切 */
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 60%);
  }

  /* 调整 Logo 在右墙面上的位置 */
  .site-title-container {
    top: 12vh;
    /* 向上移动一点，确保在可视区 */
    left: 20px;
    /* 相对于 right-wall-front 的左边缘 */
    transform: rotate(8deg) skewX(-15deg) scale(0.7);
    transform-origin: left top;
  }

  .whale-bg-container {
    left: auto;
    right: 5vw;
    /* 靠右对齐 */
    top: 5vh;
    width: 65vw;
    height: 35vh;
    transform: scale(0.7);
    transform-origin: right top;
  }

  /* 文章主区域占满屏幕宽度，并在底部留出给底栏的 padding */
  .main-content {
    flex: 1;
    margin-left: 0;
    padding: 25vh 5vw 120px 5vw;
  }

  .post-card {
    margin-left: 0 !important;
    padding: 1.2rem;
    background: transparent;
  }

  .post-card::before {
    display: none;
  }

  /* 在手机端保留桌面效果，但缩小左侧 X 坐标防止过于侵占屏幕 */
  .card-floor {
    clip-path: polygon(80px 100%,
        180px calc(100% - 120px),
        calc(100% - 120px) calc(100% - 80px),
        calc(100% - 160px) 100%);
  }

  .glass-reflection {
    display: none;
  }

  /* 移动端字体自适应精致调优 */
  .post-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
  }

  .post-card-meta {
    gap: 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
  }

  .post-card-excerpt,
  .post-card-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
  }

  .post-title {
    font-size: 1.7rem;
  }

  .post-content {
    font-size: 1.0rem;
    line-height: 1.7;
  }

  .archive-title {
    font-size: 1.6rem;
  }

  .archive-year {
    font-size: 1.3rem;
  }

  .post-card-thumbs {
    gap: 6px;
    margin-bottom: 1.2rem;
    max-width: 100% !important;
  }

  .post-card-thumbs.grid-2,
  .post-card-thumbs.grid-4 {
    max-width: 100% !important;
  }

  .post-card-thumbs.grid-1 .post-thumb-item {
    width: 200px;
    height: 200px;
  }

  /* 移动端底部导航栏样式 */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 49px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
  }

  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
      height: calc(49px + env(safe-area-inset-bottom));
    }
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #888888;
    text-decoration: none;
    font-size: 0.65rem;
    transition: all 0.2s ease;
  }

  .bottom-nav-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 1px;
    transition: transform 0.2s ease;
  }

  .bottom-nav-text {
    font-weight: 500;
  }

  .bottom-nav-item.active {
    color: #0099ff;
  }

  .bottom-nav-item.active .bottom-nav-icon {
    transform: translateY(-2px);
  }
}