/* 飞溯网 - 主样式文件 */

:root {
  /* 主色调 */
  --primary-color: #10B981; /* 绿色 */
  --primary-dark: #059669;
  --primary-light: #D1FAE5;
  
  /* 辅助颜色 */
  --secondary-color: #F59E0B; /* 橙色 */
  --secondary-dark: #D97706;
  --secondary-light: #FEF3C7;
  
  /* 红色系 - 用于祭拜活动 */
  --red-color: #EF4444;
  --red-dark: #DC2626;
  --red-light: #FEE2E2;
  
  /* 灰色系 */
  --gray-100: #F5F5F5;
  --gray-200: #E5E5E5;
  --gray-300: #D4D4D4;
  --gray-400: #A3A3A3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  
  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  line-height: 1.5;
  color: var(--gray-800);
  background-color: var(--gray-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 通用容器样式 */
.container {
  width: 100%;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

/* 链接样式 */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover {
  color: var(--primary-dark);
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
}

.btn-red {
  background-color: var(--red-color);
  color: white;
}

.btn-red:hover {
  background-color: var(--red-dark);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  border-color: var(--gray-500);
  color: var(--gray-900);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 50%;
}

/* 输入框样式 */
.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--gray-300);
  background-color: white;
  font-size: 0.875rem;
  transition: border-color 0.2s ease-in-out;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 1rem;
}

.card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.card-text {
  color: var(--gray-600);
  font-size: 0.875rem;
}

/* 徽章样式 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.badge-secondary {
  background-color: var(--secondary-light);
  color: var(--secondary-dark);
}

.badge-red {
  background-color: var(--red-light);
  color: var(--red-dark);
}

/* 状态栏样式 */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: white;
  font-size: 0.875rem;
}

/* 导航栏样式 */
.navbar {
  background-color: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
}

.navbar-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
}

/* 底部标签栏样式 */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  color: var(--gray-400);
  transition: color 0.2s;
}

.tab-item.active {
  color: var(--primary-color);
}

.tab-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.tab-label {
  font-size: 0.75rem;
}

.tab-center {
  position: relative;
}

.tab-center-button {
  position: absolute;
  top: -1.25rem;
  background-color: var(--primary-color);
  color: white;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 页面内容区域 */
.content {
  padding: 1rem;
  padding-bottom: 5rem; /* 为底部导航留出空间 */
}

/* 加载状态 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
}

.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* 故事卡片 */
.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.story-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: linear-gradient(to bottom right, var(--primary-color), var(--primary-dark));
  padding: 0.125rem;
  margin-bottom: 0.25rem;
}

.story-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: white;
  padding: 0.125rem;
  overflow: hidden;
}

.story-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.story-name {
  font-size: 0.75rem;
  color: var(--gray-600);
}

/* 家族树卡片 */
.family-tree-card {
  background-color: white;
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.family-tree-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.family-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.family-info h4 {
  font-weight: 600;
  font-size: 0.875rem;
}

.family-info p {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* 系统类型指示器（正常情况下隐藏，仅用于开发调试） */
.system-type-indicator {
  display: none;
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  z-index: 1000;
}
