/* ============================================
   Caleb 个人网站 - 组件样式
   ============================================ */

/* ============================================
   玻璃拟态卡片 Glass Card
   ============================================ */
.glass-card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  transition: all var(--duration-slow) var(--ease-standard);
  overflow: hidden;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 138, 105, 0.3);
  box-shadow: 
    0 12px 48px rgba(255, 138, 105, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.glass-card .card-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  filter: saturate(0.8) brightness(1.1);
  transition: opacity var(--duration-slow) var(--ease-standard);
}

.glass-card:hover .card-background {
  opacity: 0.2;
}

.glass-card .card-content {
  position: relative;
  z-index: 1;
  padding: var(--space-2xl);
}

.card-title {
  font-size: var(--text-h3);
  font-weight: 400;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.card-location {
  font-size: var(--text-caption);
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
}

.card-description {
  font-size: var(--text-body-m);
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

/* ============================================
   左侧Tab栏 Sidebar - 微弧曲线设计 (占40%宽度)
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 40vw; /* 占五分之二 */
  height: 100vh;
  /* 米白色背景 - 比Claude主界面深一点 */
  background: #E8E4DE;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  /* 微弧曲线边缘 - 使用SVG clipPath */
  clip-path: url(#sidebarCurve);
  /* 动态缩放的过渡 */
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left center;
  animation: slideInLeft var(--duration-slow) var(--ease-standard) 0.3s forwards;
}

/* 侧边栏悬浮时放大（仅在非narrow模式） */
.sidebar:hover:not(.narrow) {
  width: 45vw;
  background: #DDD9D3;
}

.sidebar:hover:not(.narrow) + .sidebar-shadow {
  width: 45vw;
}

/* ============================================
   非Home页 - 窄版垂直边Tab栏 (占1/15，约6.67vw)
   ============================================ */
.sidebar.narrow {
  width: 6.67vw;
  min-width: 80px; /* 最小宽度保证可用性 */
  clip-path: none; /* 移除曲线，变成垂直边 */
  /* 禁止悬浮变宽 - 覆盖所有过渡和悬浮效果 */
  transition: none !important;
}

/* 禁止窄版悬浮变宽 */
.sidebar.narrow:hover {
  width: 6.67vw;
  min-width: 80px;
  background: #E8E4DE; /* 保持原色 */
}

.sidebar.narrow .sidebar-content {
  width: 100%;
  max-width: none;
  padding: var(--space-sm) var(--space-xs);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar.narrow .tab-group {
  width: 100%;
  align-items: center;
}

.sidebar.narrow .tab-item {
  width: 100%;
  padding: var(--space-md) var(--space-xs);
  justify-content: center;
  text-align: center;
}

.sidebar.narrow .tab-text {
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Tab栏阴影层 - 更明显的覆盖效果 */
.sidebar-shadow {
  position: fixed;
  left: 0;
  top: 0;
  width: 40vw;
  height: 100vh;
  z-index: 99;
  pointer-events: none;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeIn var(--duration-slow) var(--ease-standard) 0.3s forwards;
}

/* 窄版阴影层 */
.sidebar-shadow.narrow {
  width: 6.67vw;
  min-width: 80px;
  transition: none !important;
}

.sidebar-shadow.narrow::before {
  right: -15px;
  width: 40px;
}

.sidebar-shadow.narrow::after {
  right: -25px;
  width: 50px;
}

/* 阴影层主体 - 使用伪元素实现多层阴影 */
.sidebar-shadow::before {
  content: '';
  position: absolute;
  top: 0;
  right: -5%;
  width: 25%;
  height: 100%;
  background: radial-gradient(
    ellipse 80% 120% at 0% 50%,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.2) 30%,
    rgba(0, 0, 0, 0.08) 60%,
    transparent 100%
  );
  filter: blur(15px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 第二层阴影 - 更远的扩散 */
.sidebar-shadow::after {
  content: '';
  position: absolute;
  top: 0;
  right: -10%;
  width: 35%;
  height: 100%;
  background: radial-gradient(
    ellipse 60% 100% at 0% 50%,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.05) 50%,
    transparent 100%
  );
  filter: blur(25px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 侧边栏边缘内渐变 - 增强立体感 */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.015) 40%,
    rgba(0, 0, 0, 0.035) 100%
  );
  pointer-events: none;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.narrow::after {
  width: 40px;
}

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

.sidebar-content {
  width: 100%;
  max-width: 280px;
  padding: var(--space-2xl);
  padding-right: var(--space-3xl);
}

.tab-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.tab-item {
  position: relative;
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: rgba(80, 70, 60, 0.6);
  transition: all var(--duration-normal) ease;
  border-radius: var(--radius-lg);
  transform: none;
}

.tab-item .tab-text {
  writing-mode: horizontal-tb;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: all var(--duration-normal) ease;
}

.tab-item:hover:not(.active) {
  color: rgba(60, 50, 40, 0.9);
  background: rgba(0, 0, 0, 0.04);
  padding-left: var(--space-2xl);
}

.tab-item:hover:not(.active) .tab-text {
  transform: translateX(8px);
}

.tab-item.active {
  color: rgba(50, 40, 30, 1);
  background: linear-gradient(
    90deg,
    rgba(180, 120, 80, 0.15) 0%,
    rgba(180, 120, 80, 0.05) 60%,
    transparent 100%
  );
  border-radius: var(--radius-lg);
}

.tab-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 28px;
  background: #A08060;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 8px rgba(160, 128, 96, 0.4);
}

/* 删除了发光点，保持简洁 */

/* 侧边栏收缩状态（主内容hover时触发） */
.sidebar.shrink {
  width: 32vw;
  opacity: 0.85;
}

.sidebar.shrink .tab-text {
  opacity: 0.7;
  font-size: 13px;
}

/* 主内容在侧边栏hover时的状态 */
.main-content.sidebar-hover {
  margin-left: 180px;
  transform: scale(0.97);
  opacity: 0.9;
}

/* ============================================
   右侧导航点 Nav Dots
   ============================================ */
.nav-dots {
  position: fixed;
  right: 0;
  top: 0;
  width: var(--nav-dots-width);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.nav-dots-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.nav-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  opacity: 0;
  animation: fadeIn var(--duration-normal) var(--ease-standard) forwards;
}

.nav-dot:nth-child(1) { animation-delay: 0.5s; }
.nav-dot:nth-child(2) { animation-delay: 0.6s; }
.nav-dot:nth-child(3) { animation-delay: 0.7s; }
.nav-dot:nth-child(4) { animation-delay: 0.8s; }
.nav-dot:nth-child(5) { animation-delay: 0.9s; }

.nav-dot:hover {
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.nav-dot.active {
  width: 12px;
  height: 12px;
  border-color: rgba(255, 138, 105, 1);
  background: rgba(255, 138, 105, 0.3);
  box-shadow: 0 0 12px rgba(255, 138, 105, 0.5);
}

.nav-label {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nav-dot:hover .nav-label {
  opacity: 1;
}

/* ============================================
   模态框 Modal
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-standard);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--duration-slow) var(--ease-standard);
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-standard);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-2xl);
}

.modal-image {
  width: 100%;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-title {
  font-size: var(--text-h3);
  font-weight: 400;
  margin-bottom: var(--space-sm);
}

.modal-subtitle {
  font-size: var(--text-body-l);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.modal-description {
  font-size: var(--text-body-m);
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: rgba(255, 138, 105, 0.2);
  border: 1px solid rgba(255, 138, 105, 0.4);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-body-m);
  transition: all var(--duration-normal) var(--ease-standard);
}

.modal-link:hover {
  background: rgba(255, 138, 105, 0.3);
  transform: translateX(4px);
}

.modal-link .arrow {
  transition: transform var(--duration-normal) var(--ease-standard);
}

.modal-link:hover .arrow {
  transform: translateX(4px);
}

/* ============================================
   移动端组件
   ============================================ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 200;
  padding: 0 var(--space-md);
  align-items: center;
  justify-content: space-between;
}

.hamburger {
  width: 32px;
  height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-standard);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-title {
  font-size: var(--text-body-l);
  font-weight: 300;
  letter-spacing: 0.05em;
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 150;
  padding-top: 56px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-standard);
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  gap: var(--space-md);
}

.mobile-menu-item {
  padding: var(--space-lg);
  font-size: var(--text-h4);
  color: var(--text-secondary);
  text-align: left;
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) var(--ease-standard);
}

.mobile-menu-item:hover,
.mobile-menu-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* ============================================
   交互元素发光效果
   ============================================ */
.interactive-element {
  position: relative;
  transition: all var(--duration-normal) ease;
}

.interactive-element::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(
    circle at center,
    rgba(255, 138, 105, 0.15),
    transparent 70%
  );
  transition: opacity var(--duration-normal) ease;
  pointer-events: none;
}

.interactive-element:hover::after {
  opacity: 1;
}

.interactive-element:hover {
  transform: translateY(-1px);
}

/* ============================================
   骨架屏
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
