/* 多页面应用导航样式 */

/* 应用容器 */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* 页面容器 */
.page-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* 页面基础样式 */
.page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px 15px 0 0;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1;
}

.page.active {
  transform: translateX(0);
  z-index: 2;
}

.page.prev {
  transform: translateX(-30%);
  z-index: 1;
}

/* 页面头部 */
.page-header {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  border-radius: 15px 15px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-header h1,
.page-header h2 {
  margin: 0;
  color: white;
  font-size: 1.5em;
  font-weight: 600;
  text-align: center;
}

.page-header .subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9em;
  margin: 5px 0 0 0;
  text-align: center;
}



/* 页面内容 */
.page-content {
  padding: 20px;
  padding-bottom: 100px; /* 为底部导航留空间 */
}

/* 主页功能网格 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.feature-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 25px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(102, 126, 234, 0.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.9));
}

.feature-card:active {
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2.5em;
  margin-bottom: 15px;
  display: block;
}

.feature-card h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.1em;
  font-weight: 600;
}

.feature-card p {
  margin: 0;
  color: #666;
  font-size: 0.9em;
  line-height: 1.4;
}

/* 底部导航栏 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  min-width: 50px;
  flex: 1;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.nav-icon {
  font-size: 1.3em;
  margin-bottom: 3px;
}

.nav-item span {
  font-size: 0.7em;
  color: white;
  font-weight: 500;
  text-align: center;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
  }
  
  .feature-card {
    padding: 20px 15px;
  }
  
  .feature-icon {
    font-size: 2em;
    margin-bottom: 10px;
  }
  
  .feature-card h3 {
    font-size: 1em;
  }
  
  .feature-card p {
    font-size: 0.8em;
  }
  
  .page-header {
    padding: 12px 15px;
  }
  
  .page-header h1,
  .page-header h2 {
    font-size: 1.3em;
  }
  
  .page-content {
    padding: 15px;
    padding-bottom: 90px;
  }
  
  .nav-item {
    padding: 4px 6px;
    min-width: 45px;
  }

  .nav-icon {
    font-size: 1.2em;
  }

  .nav-item span {
    font-size: 0.65em;
  }
}

/* 页面切换动画 */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

/* 页面加载动画 */
.page-loading {
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* 安全区域适配 */
@supports (padding: max(0px)) {
  .bottom-nav {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .page-content {
    padding-bottom: max(100px, calc(90px + env(safe-area-inset-bottom)));
  }
}

/* 模态框样式 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
