/* =========================================
   Visual DNA: Mint Green (#00b894) + Large Radius + Soft Shadow + Grid Bg
   ========================================= */
:root {
    --primary: #00b894;
    --primary-hover: #00a383;
    --text-main: #2d3436;
    --text-sub: #636e72;
    --bg-body: #f5f5f5;
    --bg-card: #ffffff;
    --radius-s: 12px;
    --radius-m: 20px;
    --radius-l: 24px;
    --shadow: 0 8px 24px -6px rgba(0, 184, 148, 0.12), 0 4px 8px -2px rgba(0,0,0,0.03);
    --grid-color: rgba(0, 184, 148, 0.05);
}
footer {
    background: #fff;
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
    color: var(--text-sub);
    font-size: 13px;
    border-top: 1px solid #e2e8f0;
}
/* Reset & Base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; min-width: 0; }
body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
                      linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul,h1,h2,h3,h4,h5 { list-style: none; padding: 0; margin: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Header & Nav */
header {
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}
.logo img { height: 36px; width: auto; }

/* 搜索框 (Visual Only) */
.search-bar {
    flex: 1;
    margin-left: 16px;
    background: #f7f9f9;
    border-radius: 30px; /* 大圆角 */
    padding: 6px 12px;
    display: flex;
    align-items: center;
}
.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 14px;
    color: #333;
}
.search-bar button {
    background: var(--primary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 新增导航栏 */
.main-nav {
    border-top: 1px solid #f0f0f0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.main-nav ul {
    display: flex;
    padding: 0 16px;
}
.main-nav li {
    margin-right: 24px;
}
.main-nav a {
    display: block;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-sub);
    position: relative;
}
.main-nav a.active {
    color: var(--primary);
    font-weight: 700;
}
.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

/* 通用板块标题 */
.sec-title {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sec-title a { font-size: 13px; color: #999; font-weight: normal; }

/* 通用 Grid 布局 (3列/4列/6列) */
.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 移动端默认 3 列 */
    gap: 12px;
}
/* 卡片样式优化 */
.card {
    background: #fff;
    border-radius: var(--radius-m);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
}
.card:active { transform: scale(0.98); }

/* 通用 APP Item 样式 */
.app-item {
    padding: 12px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.app-item a{
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.app-item img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-s);
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.app-item h4 {
    font-size: 13px;
    color: var(--text-main);
    margin: 0 0 4px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-item .size {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
}
.app-item .btn-dl {
    font-size: 12px;
    color: var(--primary);
    background: rgba(0, 184, 148, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

/* 移动端 4 列模式 (用于猜你喜欢等较密集的区域) */
.grid-mobile-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.grid-mobile-4 .app-item img { width: 48px; height: 48px; }

/* PC 适配 */
@media (min-width: 769px) {
    .header-top { padding: 16px 0; }
    .search-bar { max-width: 400px; margin: 0 40px; }
    .main-nav ul { justify-content: center; }
    .app-grid { grid-template-columns: repeat(6, 1fr); gap: 20px; }
    .grid-mobile-4 { grid-template-columns: repeat(6, 1fr); gap: 20px; }
}