/* 追光 App - 公共样式文件 */

/* ==================== 全局变量 ==================== */
:root {
  /* 主题色 */
  --sunrise-start: #ff6b6b;
  --sunrise-end: #ffd93d;
  --sunset-start: #ff8c42;
  --sunset-end: #6c5ce7;

  /* 背景色 */
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-card: rgba(255, 255, 255, 0.05);

  /* 文字颜色 */
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666666;

  /* 尺寸 */
  --status-bar-height: 54px;
  --tab-bar-height: 83px;
  --safe-area-top: 54px;
  --safe-area-bottom: 34px;
}

/* ==================== 通用样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overscroll-behavior: none; /* 防止橡皮筋效果 */
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 隐藏滚动条但保持滚动功能 */
*::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

* {
  -ms-overflow-style: none; /* IE, Edge */
  scrollbar-width: none; /* Firefox */
}

/* ==================== iOS 状态栏 ==================== */
.status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--status-bar-height);
  background: transparent; /* 状态栏背景透明 */
  display: flex;
  align-items: center;
  justify-content: center; /* 居中对齐，方便放置灵动岛 */
  padding: 0 24px;
  z-index: 1000;
  font-size: 15px;
  font-weight: 600;
}

/* 灵动岛 (药丸型) */
.dynamic-island {
  width: 120px;
  height: 36px;
  background: #000000;
  border-radius: 20px;
  position: fixed; /* 改为 fixed，确保滚动时固定 */
  left: 50%;
  top: 11px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  z-index: 1001;
}

.status-bar .time {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 600;
}

.status-bar .left-icons {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 8px;
}

.status-bar .right-icons {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
}

.status-bar i {
  font-size: 14px;
}

/* ==================== 内容区域 ==================== */
.app-content {
  padding-top: var(--status-bar-height);
  padding-bottom: var(--tab-bar-height);
  min-height: 100vh;
  position: relative;
}

/* ==================== 玻璃态卡片 ==================== */
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 渐变按钮 ==================== */
.gradient-button {
  background: linear-gradient(135deg, var(--sunrise-start), var(--sunrise-end));
  border: none;
  border-radius: 16px;
  padding: 14px 28px;
  color: white;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
  transition: all 0.3s ease;
}

.gradient-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.gradient-button:active {
  transform: translateY(0);
}

/* ==================== 底部 Tab Bar ==================== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tab-bar-height);
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 0.5px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 8px 0 var(--safe-area-bottom);
  z-index: 1000;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-secondary);
}

.tab-item i {
  font-size: 24px;
  transition: all 0.3s ease;
}

.tab-item span {
  font-size: 11px;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

.tab-item.active i {
  background: linear-gradient(135deg, var(--sunrise-start), var(--sunrise-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: scale(1.1);
}

.tab-item:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* ==================== 日出日落渐变 ==================== */
.sunrise-gradient {
  background: linear-gradient(135deg, var(--sunrise-start), var(--sunrise-end));
}

.sunset-gradient {
  background: linear-gradient(135deg, var(--sunset-start), var(--sunset-end));
}

/* ==================== 加载动画 ==================== */
@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

.skeleton {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 800px 100px;
  animation: shimmer 2s infinite;
  border-radius: 12px;
}

/* ==================== 脉动动画 ==================== */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==================== 搜索框样式 ==================== */
.search-input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 16px;
  width: 100%;
  outline: none;
  transition: all 0.3s ease;
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 107, 107, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* ==================== 响应式 ==================== */
@media (max-width: 393px) {
  .glass-card {
    padding: 16px;
  }

  .tab-bar {
    padding: 6px 0 var(--safe-area-bottom);
  }

  .tab-item i {
    font-size: 22px;
  }

  .tab-item span {
    font-size: 10px;
  }
}
