/* 全局样式 - 匹配图片设计 */
:root {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --primary-color: #1677ff;
    --border-color: #e8e8e8;
    --tab-active-bg: #1677ff;
    --tab-active-text: #ffffff;
    --tab-inactive-bg: #ffffff;
    --tab-inactive-text: #666;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1850px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 顶部导航（复用首页导航样式） ========== */
.app-navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-logo {
    text-decoration: none;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link a {
    text-decoration: none;
    color: #666;
    font-size: 15px;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-link.active a {
    color: #05d9c5;
    border-bottom-color: #05d9c5;
    font-weight: 600;
}

.nav-link a:hover {
    color: #05d9c5;
}

.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    max-width: 500px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 10px 16px;
    gap: 10px;
    width: 100%;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.search-box:focus-within {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.search-box i {
    color: #999;
    font-size: 14px;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    flex: 1;
    color: #333;
}

.search-input::placeholder {
    color: #999;
}

/* 搜索下拉面板（复用首页样式） */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 24px;
    min-height: 200px;
    max-height: 420px;
    overflow: hidden;
}

.search-dropdown.active {
    display: block;
}

.search-default-panel {
    display: block;
    position: relative;
}

.search-results-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.search-results-panel.active {
    display: block;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    flex-shrink: 0;
}

.search-result-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.search-panel {
    display: flex;
    gap: 40px;
    min-height: 200px;
}

.search-results {
    flex: 1;
    max-width: 260px;
}

.search-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
}

.hot-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hot-item:hover {
    background: #f8f8f8;
}

.hot-rank {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #999;
    border-radius: 4px;
    flex-shrink: 0;
}

.hot-rank-1 { background: linear-gradient(135deg, #ff6b6b, #ee5a5a); color: #fff; }
.hot-rank-2 { background: linear-gradient(135deg, #ffa94d, #ff922b); color: #fff; }
.hot-rank-3 { background: linear-gradient(135deg, #ffd43b, #fcc419); color: #fff; }

.hot-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.hot-tag {
    font-size: 10px;
    font-weight: 700;
    color: #ff6b6b;
    background: rgba(255,107,107,0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.search-recommend {
    flex: 1;
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.recommend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f8f8;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.recommend-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.recommend-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
}

.recommend-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recommend-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recommend-count {
    font-size: 11px;
    color: #999;
}

/* ========== 主内容区 ========== */
.main-content {
    padding: 24px 0 40px;
}

/* 子类型标签导航 */
.subType-tabs {
    margin-bottom: 32px;
}

.tabs-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tab-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: var(--tab-inactive-bg);
    color: var(--tab-inactive-text);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

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

.tab-item.active {
    background: var(--tab-active-bg);
    color: var(--tab-active-text);
    border-color: var(--tab-active-bg);
}

/* 应用卡片网格 */
.app-grid-container {
    position: relative;
}

.subType-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.subType-grid.active {
    display: grid;
}

/* 应用卡片 */
.app-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}

/* 图标区域 */
.card-icon-wrapper {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-icon-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    object-fit: contain;
    border-radius: 8px;
}

/* 内容区域 */
.card-content {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 40px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.card-rating i {
    color: #ffa726;
    font-size: 11px;
}

.card-download-btn {
    padding: 4px 12px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.card-download-btn:hover {
    background: #4096ff;
}

/* 暂无数据样式 */
.empty-data {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-data i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-data p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ========== 底部信息（复用首页样式） ========== */
.site-footer {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: rgba(255, 255, 255, 0.8);
    padding: 60px 0 30px;
    margin-top: 60px;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #05d9c5, #04b8a6, #05d9c5);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-info {
    flex: 1;
    min-width: 300px;
}

.footer-info .footer-logo {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #05d9c5, #04b8a6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-info p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.6);
}

.footer-info p:first-of-type {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
}

.footer-links {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 6px;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 12px;
    right: 12px;
    height: 1px;
    background: #05d9c5;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.footer-links a:hover {
    color: #05d9c5;
}

.footer-links a:hover::after {
    transform: scaleX(1);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #05d9c5, #04b8a6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(5, 217, 197, 0.3);
}

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

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(5, 217, 197, 0.4);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .subType-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .subType-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .tab-item {
        padding: 6px 16px;
        font-size: 13px;
    }

    .card-name {
        font-size: 13px;
        min-height: 36px;
    }

    .card-download-btn {
        padding: 3px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .subType-tabs {
        margin-bottom: 20px;
    }

    .tabs-wrapper {
        gap: 8px;
    }

    .tab-item {
        padding: 6px 12px;
        font-size: 12px;
    }

    .subType-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card-content {
        padding: 10px;
    }
}
