/* H5念念游戏库 - 现代精美设计 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #ff6b6b;
  --primary-dark: #ee5a6f;
  --bg-color: #0f0f1a;
  --card-bg: #1a1a2e;
  --card-hover: #252542;
  --sidebar-bg: #12121f;
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --accent: #ffd93d;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
}

/* 顶部栏 */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
}

.top-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #ffa8a8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

.search-box {
  flex: 1;
  max-width: 300px;
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  outline: none;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all 0.3s;
}

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

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

/* 布局 */
.layout {
  display: flex;
  min-height: 100vh;
}

/* 侧栏 */
.sidebar {
  width: 110px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  padding: 20px 0;
}

/* 分类列表 */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  background: transparent;
  width: 100%;
}

.category-item:hover {
  background: var(--card-bg);
}

.category-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

.category-icon {
  font-size: 24px;
}

.category-name {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.category-item.active .category-name {
  color: white;
}

/* 主内容 */
.main {
  flex: 1;
  padding: 20px;
}

.app-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 700px;
  margin: 0 auto;
}

/* 游戏卡片 */
.app-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 14px;
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #ffa8a8, var(--accent));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.app-card:hover::before {
  transform: scaleX(1);
}

.app-card:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--border-color);
}

.app-info {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.app-desc {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 8px;
}

.app-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.app-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

.app-action {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  font-size: 14px;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 加载 */
.loading {
  display: flex;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 107, 107, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 移动端 */
@media (max-width: 768px) {
  .top-bar {
    padding: 12px 16px;
  }

  .top-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .logo {
    text-align: center;
  }

  .search-box {
    max-width: none;
  }

  .sidebar {
    width: 80px;
  }

  .category-item {
    padding: 12px 6px;
  }

  .category-icon {
    font-size: 20px;
  }

  .category-name {
    font-size: 10px;
  }

  .main {
    padding: 16px;
  }

  .app-icon {
    width: 50px;
    height: 50px;
  }

  .app-name {
    font-size: 14px;
  }

  .app-desc {
    font-size: 11px;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
