/* 公共样式 - 全站通用 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 移动端适配 */
html {
  font-size: 16px;
}

@media screen and (min-width: 375px) {
  html {
    font-size: calc(16px + 2 * ((100vw - 375px) / 375));
  }
}

@media screen and (min-width: 750px) {
  html {
    font-size: 18px;
  }
}

/* 链接样式 */
a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

/* 通用容器 */
.container {
  max-width: 750px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 顶部导航栏 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
}

.header-logo {
  font-size: 1.25rem;
  font-weight: bold;
  color: #4a90e2;
}

.header-search {
  flex: 1;
  max-width: 500px;
  margin: 0 15px;
}

.search-input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #e0e0e0;
  border-radius: 17px;
  background-color: #f5f5f5;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.3s;
}

.search-input:focus {
  background-color: #fff;
  border-color: #4a90e2;
}

/* 主内容区域 */
.main-content {
  padding-top: 50px;
  min-height: calc(100vh - 50px);
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.875rem;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
}

.btn-primary {
  background-color: #4a90e2;
  color: #fff;
}

.btn-primary:active {
  background-color: #3a7bc8;
}

.btn-download {
  background-color: #52c41a;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.813rem;
}

.btn-download:active {
  background-color: #3ea015;
}

/* 加载中状态 */
.loading {
  text-align: center;
  padding: 20px;
  color: #999;
}

.loading::after {
  content: "...";
  display: inline-block;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0%, 20% { content: "."; }
  40% { content: ".."; }
  60%, 100% { content: "..."; }
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

/* 分割线 */
.divider {
  height: 1px;
  background-color: #e0e0e0;
  margin: 15px 0;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background-color: rgba(74, 144, 226, 0.8);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:active {
  background-color: rgba(58, 123, 200, 0.9);
}

/* 汉堡菜单图标 */
.hamburger-menu {
  width: 24px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  padding: 2px 0;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #52c41a;
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger-menu:active {
  opacity: 0.7;
}
/* 分类菜单弹出层 */
.category-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-overlay.active {
  display: block;
  opacity: 1;
}

.category-panel {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.category-overlay.active .category-panel {
  transform: translateY(0);
}

.category-tabs {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
}

.category-tab {
  flex: 1;
  padding: 12px 0;
  background-color: transparent;
  border: none;
  font-size: 0.938rem;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-tab.active {
  color: #52c41a;
  font-weight: 600;
  border-bottom: 2px solid #52c41a;
}

.category-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.category-content {
  display: none;
}

.category-content.active {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* 网格卡片样式 */
.category-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  background-color: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 100px;
}

.category-grid-item:active {
  background-color: #f5f5f5;
  transform: scale(0.98);
}

.category-grid-name {
  font-size: 0.938rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  text-align: center;
}

.category-grid-count {
  font-size: 0.75rem;
  color: #999;
  text-align: center;
}