/* ========================================
   au应用中心 - 前台样式
   ======================================== */
:root {
    --primary: #0077B8;
    --primary-dark: #005F92;
    --primary-light: #E8F4FD;
    --white: #FFFFFF;
    --bg: #F5F5F5;
    --text: #222222;
    --text-sub: #555555;
    --text-muted: #999999;
    --border: #E0E0E0;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--text); text-decoration: none; }

/* ===== 蓝色头部横幅（Logo + 搜索框） ===== */
.hero-banner {
    background: linear-gradient(135deg, #006699 0%, #0099CC 100%);
    padding: 14px 16px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.hero-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hero-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    flex-shrink: 0;
}

.hero-logo-icon {
    font-size: 26px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.hero-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hero-user-link {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.hero-user-link:hover { color: var(--white); }

.hero-user-register {
    background: rgba(255,255,255,0.2);
    padding: 4px 14px;
    border-radius: 20px;
    color: var(--white);
    font-size: 12px;
}

/* 搜索框在头部内 */
.hero-search {
    display: flex;
    border-radius: 22px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.hero-search-field {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    color: var(--text);
}

.hero-search-field::placeholder { color: #AAAAAA; }

.hero-search-btn {
    width: 44px;
    border: none;
    background: var(--primary);
    color: var(--white);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-search-btn:hover { background: var(--primary-dark); }

/* ===== 分类标签（药丸形横向滚动） ===== */
.category-bar {
    background: var(--white);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-bar::-webkit-scrollbar { display: none; }

.category-list {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    max-width: 1200px;
    margin: 0 auto;
    list-style: none;
    flex-wrap: nowrap;
}

.category-item {
    flex-shrink: 0;
}

.category-link {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    background: #F0F0F0;
    color: var(--text-sub);
}

.category-link:hover {
    background: #E0E0E0;
    color: var(--text);
}

.category-link.active {
    background: var(--primary);
    color: var(--white);
}

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

.main-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* 搜索提示 */
.search-hint {
    background: var(--white);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-sub);
    box-shadow: var(--shadow);
}

.clear-search {
    color: var(--primary);
    margin-left: 8px;
    font-size: 16px;
}

/* ===== 应用卡片网格 ===== */
.app-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.app-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    display: block;
}

.app-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    color: var(--text);
}

/* 卡片顶部绿色渐变区域 */
.app-card-banner {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #00B894 0%, #00D68F 100%);
}

.app-card-banner.plugin {
    background: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%);
}

.app-card-banner.theme {
    background: linear-gradient(135deg, #00B894 0%, #00D68F 100%);
}

/* 图标容器（白色圆角方块） */
.app-card-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.app-card-icon {
    font-size: 30px;
}

/* 卡片内容区 */
.app-card-info {
    padding: 10px 12px 12px;
}

.app-card-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.app-card-desc {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.4;
    height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
}

.app-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.app-card-ver {
    color: var(--text-sub);
    font-weight: 500;
}

.app-card-author {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 55%;
}

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

.app-card-dl {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.app-card-btn {
    display: inline-block;
    padding: 5px 18px;
    background: var(--primary);
    color: var(--white);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.app-card-btn:hover {
    background: var(--primary-dark);
    color: var(--white);
}

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

.empty-icon { font-size: 48px; margin-bottom: 12px; }

.empty-state p { font-size: 14px; margin-bottom: 16px; }

.empty-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary);
    color: var(--white);
    border-radius: 20px;
    font-size: 13px;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
}

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
}

.pg-btn:hover { border-color: var(--primary); color: var(--primary); }

.pg-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.pg-dots {
    color: var(--text-muted);
    padding: 0 4px;
    font-size: 12px;
}

/* ===== 底部 ===== */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 20px 16px;
    margin-top: 16px;
    text-align: center;
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 12px;
}

.footer-stat { text-align: center; }

.stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.stat-txt {
    font-size: 12px;
    color: var(--text-muted);
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   响应式
   ======================================== */

/* >=768px 平板/PC：4列网格 */
@media (min-width: 768px) {
    .app-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .app-card-banner { height: 120px; }

    .app-card-icon-wrap { width: 60px; height: 60px; }
    .app-card-icon { font-size: 32px; }

    .app-card-info { padding: 12px 14px 14px; }
    .app-card-name { font-size: 15px; }
    .app-card-desc { height: 38px; font-size: 13px; }

    .hero-banner { padding: 16px 24px 18px; }
    .hero-logo { font-size: 20px; }
    .hero-logo-icon { font-size: 28px; }

    .hero-search-field { padding: 11px 20px; font-size: 15px; }
    .hero-search-btn { width: 48px; font-size: 18px; }

    .category-list { padding: 0 24px; gap: 10px; }
    .category-link { padding: 7px 22px; font-size: 14px; }

    .main-content { padding: 16px 24px 32px; }
}

/* >=992px PC：4列 */
@media (min-width: 992px) {
    .app-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .app-card-banner { height: 130px; }

    .app-card-icon-wrap { width: 64px; height: 64px; border-radius: 16px; }
    .app-card-icon { font-size: 34px; }

    .app-card-info { padding: 12px 14px 14px; }
    .app-card-name { font-size: 15px; }
    .app-card-desc { height: 40px; }
}

/* >=1200px 大屏 */
@media (min-width: 1200px) {
    .app-grid { gap: 18px; }
}

/* <=480px 小手机 */
@media (max-width: 480px) {
    html { font-size: 13px; }

    .hero-banner { padding: 10px 12px 12px; }
    .hero-top { margin-bottom: 10px; }
    .hero-logo { font-size: 16px; gap: 6px; }
    .hero-logo-icon { font-size: 22px; }
    .hero-user { gap: 6px; }
    .hero-user-link { font-size: 12px; }
    .hero-user-register { padding: 3px 10px; font-size: 11px; }

    .hero-search-field { padding: 8px 12px; font-size: 13px; }
    .hero-search-btn { width: 40px; font-size: 15px; }

    .category-list { padding: 0 12px; gap: 6px; }
    .category-link { padding: 5px 14px; font-size: 12px; }

    .main-content { padding: 10px 12px 20px; }
    .app-grid { gap: 8px; }

    .app-card-banner { height: 95px; }
    .app-card-icon-wrap { width: 48px; height: 48px; border-radius: 12px; }
    .app-card-icon { font-size: 26px; }

    .app-card-info { padding: 8px 10px 10px; }
    .app-card-name { font-size: 13px; }
    .app-card-desc { font-size: 11px; height: 30px; margin-bottom: 5px; }
    .app-card-meta { font-size: 10px; margin-bottom: 6px; }
    .app-card-ver { font-size: 10px; }
    .app-card-author { font-size: 10px; }
    .app-card-dl { font-size: 10px; }
    .app-card-btn { padding: 4px 14px; font-size: 11px; }

    .pg-btn { min-width: 30px; height: 30px; font-size: 12px; }

    .footer-stats { gap: 20px; flex-wrap: wrap; }
    .stat-num { font-size: 16px; }
    .stat-txt { font-size: 11px; }
    .footer-copy { font-size: 11px; }
}

/* <=360px 超小屏 */
@media (max-width: 360px) {
    .app-grid { gap: 6px; }
    .app-card-banner { height: 85px; }
    .app-card-icon-wrap { width: 42px; height: 42px; border-radius: 10px; }
    .app-card-icon { font-size: 22px; }
    .app-card-name { font-size: 12px; }
    .app-card-desc { height: 26px; font-size: 10px; }
    .app-card-btn { padding: 3px 12px; font-size: 10px; }
    .category-link { padding: 4px 12px; font-size: 11px; }
}
