/* --- Main Container (Genius UI Overhaul - Light Theme) --- */
/* --- Footer animation --- */
footer.input-area {
    transition: opacity 0.3s ease, transform 0.3s ease, height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
    overflow: hidden;
}

.footer-hidden {
    opacity: 0;
    height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-width: 0 !important;
    transform: translateY(20px);
    pointer-events: none;
}

/* --- Main Container (Genius UI Overhaul - Light Theme) --- */
.page-container p,
.page-container span,
.page-container div {
    font-size: 1em; /* Consistent with chat area */
    font-weight: 400; /* Consistent with chat area */
    line-height: 1.6;
    color: #1a1a1a; /* Explicitly set to a dark color for better visibility */
}

.chat-app-container {
  max-width: 910px;
  width: 96%;
  height: 90vh;
  max-height: 700px;
  margin: 20px auto;

  /* 统一纯色玻璃效果 */
  background: var(--unified-bg);
  backdrop-filter: blur(20px) saturate(2) brightness(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(2) brightness(1.3);
  border: 2px solid var(--unified-border);
  border-radius: var(--radius-xl);
  
  /* 3D Physicality */
  position: relative;
  z-index: 1;
  transform: rotateX(0deg) rotateY(0deg);
  transform-style: preserve-3d;
  /* 移除全局过渡效果，防止意外的位置变化 */
  /* transition: all 0.6s cubic-bezier(0.25, 0.1, 0.25, 1); */

  /* Unified Glossy Glass Shadow - 保持白色透明效果 */
  box-shadow:
    inset 0px 3px 12px rgba(255, 255, 255, 0.4),
    inset -2px -3px 6px rgba(255, 255, 255, 0.25),
    0 20px 40px rgba(0,0,0,0.08),
    0 8px 16px rgba(0,0,0,0.05);

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Removed hover tilt interaction */

/* 统一内发光效果 - 移除渐变 */
.chat-app-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: var(--unified-glass);
    opacity: 0.8;
    pointer-events: none;
    z-index: 1; /* Above background, below content */
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}


/* --- Header (Genius UI Overhaul - 亮面玻璃效果) --- */
.app-header {
  padding: 18px 24px;
  border-bottom: none; /* 移除分割线 */
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  /* 统一玻璃效果 - 纯色方案 */
  background: var(--unified-glass);
  backdrop-filter: blur(20px) saturate(200%) brightness(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(200%) brightness(1.2);
  border: 2px solid var(--unified-border);
  border-radius: var(--radius-lg);
  
  position: relative;
  flex-shrink: 0;
  transform: translateZ(40px);
  
  /* 玻璃阴影效果 */
  box-shadow:
    inset 0px 2px 8px rgba(255, 255, 255, 0.25),
    inset -1px -2px 4px rgba(255, 255, 255, 0.15),
    0 12px 30px rgba(0,0,0,0.2);
  
  transition: all 0.6s var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
  overflow: hidden;

  /* === 头部亮面玻璃呼吸动画 === */
/* 暂时禁用呼吸动画，防止影响窗口位置 */
/* animation: glass-breath 4s ease-in-out infinite; */
}

/* 闪光动画效果 */
.app-header::before {
  content: '';
  position: absolute;
  top: 0; 
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.6) 50%, 
    rgba(255, 255, 255, 0) 100%);
  transition: left 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
  z-index: 3;
}

.app-header:hover::before {
  left: 100%;
}

/* 亮面高光效果 */
.app-header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
  opacity: 0.8;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.6s var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));

  /* 头部亮面玻璃呼吸动画 */
/* 暂时禁用高光脉冲动画，防止影响窗口位置 */
/* animation: glass-highlight-pulse 3s ease-in-out infinite; */
}

.app-header:hover {
  background: var(--unified-glass);
  opacity: 0.9;
  box-shadow:
    inset 0px 4px 15px rgba(255, 255, 255, 0.35),
    inset -2px -4px 8px rgba(255, 255, 255, 0.2),
    0 20px 40px rgba(0,0,0,0.25);
  transform: translateZ(40px);
}

.app-header:hover::after {
  opacity: 1;
}

.app-header h1 {
  font-size: 1.8em; /* 增加字体大小 */
  margin: 0;
  font-weight: 800; /* 增加字体重量，更显眼 */
  letter-spacing: -0.1px; /* 调整字间距 */
  color: #1a1a1a; /* 深色文字确保可见性 */
  text-shadow:
    0 1px 3px rgba(255,255,255,0.9),
    0 0 6px rgba(255,255,255,0.7),
    0 2px 4px rgba(0,0,0,0.1); /* 增强阴影效果，更显眼 */
  position: relative;
  z-index: 4; /* 确保在闪光效果之上 */
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--padding-md);
  position: relative;
  z-index: 5; /* 确保在闪光效果之上 */
}

.header-controls .icon-button {
  background: var(--unified-button); /* 统一按钮背景 */
  border: 1px solid var(--unified-border);
  border-radius: var(--radius-md);
  padding: 8px;
  transition: all 0.3s ease;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.header-controls .icon-button:hover {
  background: var(--unified-button);
  opacity: 0.8;
  border-color: var(--unified-border);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.header-controls .icon-button svg {
    stroke: #1a1a1a; /* 深色图标确保可见性 */
    transition: all 0.2s ease;
}

.header-controls .icon-button:hover svg {
    stroke: #000000; /* 悬停时更深色 */
}

/* Adjust navigation tabs for the new design */
.page-navigation {
    transform: translateZ(40px);
    margin-right: auto; /* Push controls to the right */
}

.app-header .page-nav-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px; /* 增加内边距 */
    color: #000000; /* Deeper color for maximum contrast */
    font-weight: 700; /* 更粗的字体重量，更显眼 */
    font-size: 1.05em; /* 增加字体大小 */


    /* 统一玻璃效果 */
    background: var(--unified-button);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1.5px solid var(--unified-border);
    border-radius: var(--radius-md);
    box-shadow:
      inset 0 1px 3px rgba(255,255,255,0.12),
      0 4px 10px rgba(0,0,0,0.12);

    will-change: transform, background, box-shadow;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.app-header .page-nav-tab:hover:not(.active) {
    background: var(--unified-button);
    opacity: 0.8;
    border-color: var(--unified-border);
    color: var(--unified-text);
    transform: translateY(-1px) scale(1.03);
    box-shadow:
      inset 0 1px 3px rgba(255,255,255,0.16),
      0 6px 18px rgba(0,0,0,0.18);
}

.app-header .page-nav-tab.active {
    color: var(--unified-text);
    background: var(--unified-glass);
    border-color: var(--unified-border);
    box-shadow:
      inset 0 1px 3px rgba(255,255,255,0.25),
      0 4px 15px rgba(255,255,255,0.2),
      0 1px 3px rgba(0,0,0,0.05);
    transform: scale(1.05);
}

/* 头部玻璃效果在暗色背景下的适配 */
@media (prefers-color-scheme: dark) {
  .app-header {
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 100%);
    border-color: rgba(255, 255, 255, 0.2);
  }
  
  .app-header:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.12) 100%);
  }
}

/* === 头部亮面玻璃呼吸动画 === */
@keyframes glass-breath {
  0%, 100% {
    box-shadow:
      inset 0px 2px 8px rgba(255, 255, 255, 0.25),
      inset -1px -2px 4px rgba(255, 255, 255, 0.15),
      0 12px 30px rgba(0,0,0,0.2);
  }
  50% {
    box-shadow:
      inset 0px 3px 12px rgba(255, 255, 255, 0.3),
      inset -1px -3px 6px rgba(255, 255, 255, 0.2),
      0 16px 35px rgba(0,0,0,0.25);
  }
}

@keyframes glass-highlight-pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}
