/* 基础样式 - 强化手机端适配 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 去除手机端点击高亮 */
}

a {
    text-decoration: none;
}

.app-card-button a {
    text-decoration: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'system-ui', sans-serif;
    background-color: #F9F9F9;
    color: #2A2A2A;
    line-height: 1.6;
    font-size: 16px;
    padding: 0 0.5rem;
}

/* 核心修改：全局容器最大宽度调窄 */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 0.75rem;
}

/* 顶部主图+文字板块样式 - 关键修复：减小底部外边距 */
.top-recommend {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem 1rem;
    margin: 1rem 0 0.5rem 0; /* 核心修改：底部外边距从1rem改为0.5rem */
    max-width: 1000px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
}

/* 左侧主图片容器 */
.recommend-img {
    width: 200px;
    height: 120px;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid #FF7A00;
}

.recommend-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 右侧文字区域 */
.recommend-text {
    flex: 1;
    min-width: 250px;
}

.recommend-title {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 700;
    color: #FF7A00;
    margin-bottom: 0.8rem;
}

.recommend-desc {
    color: #374151;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* 滚动公告栏样式 - 新增淡色背景，精简样式 */
.scroll-notice {
    flex: 1;
    margin: 0;
    padding: 0.4rem 0.6rem;
    border-left: 4px solid #FF7A00;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    height: 1.8rem;
    line-height: 1.8rem;
    min-width: 200px;
    background-color: #FFF9F2;
}

.notice-list {
    list-style: none;
    position: absolute;
    top: 0;
    left: 0.8rem;
    animation: scrollUp 15s linear infinite;
}

.notice-item {
    height: 1.8rem;
    color: #e65100;
    font-size: 0.8rem;
}

.notice-item span {
    color: #FF7A00;
    font-weight: 600;
}

/* 滚动动画 */
@keyframes scrollUp {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100%);
    }
}

/* 分类导航容器 - 核心：清除顶部空白，缩小外边距和间距 */
.category-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    margin-top: 0; /* 清除顶部空白 */
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

/* 分类按钮容器 - 新增垂直居中 */
.category-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center; /* 垂直居中 */
}

/* 标签页切换样式 - 新增核心样式 */
.tab-container {
    width: 100%;
    margin-bottom: 1rem;
}
.tab-nav {
    display: flex;
    gap: 2px;
    background-color: #fff;
    padding: 4px;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    /* 核心修改：吸顶样式优化 - 全端吸顶，移动端优先级更高 */
    position: sticky;
    top: 0; /* 直接吸顶，避免计算导航栏高度导致的错位 */
    z-index: 99; /* 提升层级，确保不被遮挡 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* 增加阴影提升层次感 */
}
.tab-item {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}
.tab-item.active {
    background-color: #FF7A00;
    color: white;
}
.tab-content {
    display: none;
    width: 100%;
}
.tab-content.active {
    display: block;
}

/* 移动端主图+文字板块适配 */
@media (max-width: 768px) {
    .top-recommend {
        padding: 1rem;
        gap: 1rem;
        justify-content: center;
        text-align: center;
        margin: 0.5rem 0; /* 移动端进一步减小上下外边距 */
    }

    .recommend-img {
        width: 160px;
        height: 100px;
    }

    /* 移动端公告栏适配 - 修复滚动动画 */
    .scroll-notice {
        padding: 0.3rem 0.5rem;
        height: 1.6rem;
        line-height: 1.6rem;
        min-width: 150px;
        font-size: 0.7rem;
    }

    .notice-list {
        position: absolute !important;
        top: 0 !important;
        left: 0.8rem !important;
        animation: scrollUpMobile 15s linear infinite !important;
    }

    .notice-item {
        height: 1.6rem;
        font-size: 0.7rem;
    }

    /* 移动端分类导航适配 */
    .category-nav {
        flex-wrap: wrap;
        gap: 0.3rem;
        margin-bottom: 0.8rem;
        margin-top: 0;
    }

    .category-buttons {
        width: 100%;
        justify-content: center;
    }

    .scroll-notice {
        width: 100%;
        margin-top: 0.3rem;
    }

    /* 移动端标签页适配 - 强化吸顶效果 */
    .tab-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    /* 手机端专属吸顶配置 - 强化吸顶 */
    .tab-nav {
        top: 0; /* 移动端直接吸顶，取消之前的高度计算 */
        width: calc(100% - 1rem); /* 适配容器内边距 */
        margin-left: auto;
        margin-right: auto;
        z-index: 999; /* 移动端提升层级，确保绝对置顶 */
    }

    /* 核心修改：移动端顶部导航栏取消吸顶 */
    header {
        position: static !important; /* 取消吸顶 */
        margin-bottom: 1rem; /* 增加底部间距，避免内容紧贴 */
    }

    /* 移动端搜索框和按钮适配 */
    header .container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem 0.75rem;
    }

    header .flex.items-center {
        margin-top: 0;
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    header .flex.items-center button {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        cursor: pointer;
    }

    .search-container {
        width: 100% !important; /* 搜索框占满宽度，提升移动端体验 */
    }
}

/* 移动端滚动动画 */
@keyframes scrollUpMobile {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-calc(100% + 10px));
    }
}

/* 超小屏手机图片适配 */
@media (max-width: 480px) {
    .recommend-img {
        width: 120px;
        height: 80px;
    }
    /* 超小屏标签栏吸顶不变 */
    .tab-nav {
        top: 0;
    }
    
    /* 超小屏公告栏适配 */
    .scroll-notice {
        height: 1.6rem !important;
        line-height: 1.6rem !important;
    }
    
    .notice-item {
        height: 1.6rem !important;
    }
}

/* 颜色定义 */
.bg-white { background-color: #fff; }
.bg-gray-50 { background-color: #F9F9F9; }
.bg-primary { background-color: #FF7A00; }
.bg-dark { background-color: #2A2A2A; }
.bg-green-500 { background-color: #10B981; }

.text-white { color: #fff; }
.text-dark { color: #2A2A2A; }
.text-gray-400 { color: #9CA3AF; }
.text-gray-500 { color: #6B7280; }
.text-gray-700 { color: #374151; }
.text-primary { color: #FF7A00; }

/* 背景色 */
.bg-blue-100 { background-color: #DBEAFE; }
.bg-green-100 { background-color: #D1FAE5; }
.bg-purple-100 { background-color: #E9D5FF; }
.bg-red-100 { background-color: #FEE2E2; }
.bg-yellow-100 { background-color: #FEF3C7; }
.bg-indigo-100 { background-color: #E0E7FF; }
.bg-teal-100 { background-color: #CCFBF1; }
.bg-pink-100 { background-color: #FCE7F3; }

/* 文字颜色 */
.text-blue-800 { color: #1E40AF; }
.text-green-800 { color: #065F46; }
.text-purple-800 { color: #5B21B6; }
.text-red-800 { color: #991B1B; }
.text-yellow-800 { color: #92400E; }
.text-indigo-800 { color: #3730A3; }
.text-teal-800 { color: #065F46; }
.text-pink-800 { color: #9D174D; }

/* 布局类 */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }

/* 间距 */
.space-y-4 > * + * { margin-top: 1rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 1.2rem; padding-bottom: 1.1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.pt-4 { padding-top: 1rem; }
.pb-2 { padding-bottom: 0.5rem; }

.mr-2 { margin-right: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-4 { margin-right: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-16 { margin-top: 1rem; } 
.mt-8 { margin-top: 2rem; }

/* 尺寸 */
.w-16 { width: 5rem; }
.h-16 { height: 5rem; }
.min-w-max { min-width: max-content; }
.w-full { width: 100%; }

/* 文字样式 */
.text-xs { font-size: 0.7rem; }
.text-sm { font-size: 0.8rem; }
.text-lg { font-size: 1rem; }
.text-xl { font-size: 1.125rem; }
.text-2xl { font-size: 1.25rem; }
.text-\[clamp(1.5rem,3vw,2rem)\] { font-size: clamp(1.2rem, 5vw, 1.8rem); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* 边框和圆角 */
.rounded-full { border-radius: 0.75rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-l-md { border-top-left-radius: 0.375rem; border-bottom-left-radius: 0.375rem; }
.rounded-r-md { border-top-right-radius: 0.375rem; border-bottom-right-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.border-b { border-bottom: 1px solid #E5E7EB; }

.border { border-width: 1px; }
.border-gray-300 { border-color: #D1D5DB; }
.border-gray-200 { border-color: #E5E7EB; }
.border-gray-800 { border-color: #1F2937; }

/* 阴影 */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.app-card-shadow { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }

/* 定位 */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.left-4 { left: 1rem; }
.z-10 { z-index: 10; }

/* 变换 */
.transform { transform: translateX(0) translateY(0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1); }
.-translate-y-1\/2 { transform: translateY(-50%); }

/* 其他 */
.object-cover { object-fit: cover; }
.overflow-x-auto { overflow-x: auto; }
.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: color 0.3s ease, background-color 0.3s ease; }

/* 交互状态 */
.hover\:bg-gray-100:hover { background-color: #F3F4F6; }
.hover\:bg-gray-50:hover { background-color: #F9FAFB; }
.hover\:text-primary:hover { color: #FF7A00; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.3); }
.focus\:ring-primary\/30:focus { box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.3); }
.focus\:border-primary:focus { border-color: #FF7A00; }

/* 自定义工具类 */
.btn-hover {
    transition: all 0.3s;
}
.btn-hover:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.tag-style {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 应用卡片布局 */
.app-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
    width: 100%;
    gap: 1rem;
    cursor: pointer; /* 添加鼠标指针，提示可点击 */
}

/* 排行榜序号样式 */
.rank-num {
    width: 2rem;
    height: 2rem;
    background-color: #FF7A00;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* 分页导航样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin: 2rem 0;
    padding: 1rem;
}

.pagination-btn {
    padding: 0.8rem 1.8rem;
    border-radius: 0.75rem;
    border: 1px solid #E5E7EB;
    background: white;
    color: #2A2A2A;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.pagination-btn.active {
    background: #FF7A00;
    color: white;
    border-color: #FF7A00;
}

.pagination-btn:hover:not(.active) {
    border-color: #FF7A00;
    color: #FF7A00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.15);
}

/* 电脑端适配 */
@media (min-width: 768px) {
    /* 电脑端保留顶部导航吸顶 */
    header {
        position: sticky !important;
        top: 0;
        z-index: 100;
    }
    
    .app-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
        gap: 1.5rem;
    }
    .app-card-content {
        margin-bottom: 0;
        justify-content: flex-start;
        flex: 1;
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    .app-card-button {
        width: auto;
        margin-left: 0;
    }
    .app-card-button button {
        padding: 0.75rem 1.25rem;
        min-width: 120px;
        cursor: pointer;
    }

    /* 电脑端标签栏吸顶位置调整，避开顶部导航 */
    .tab-nav {
        top: 80px;
        z-index: 9;
    }
}

/* 手机端适配 - 重点优化 */
@media (max-width: 767px) {
    .app-card {
        padding: 0.75rem;
        flex-wrap: nowrap;
        overflow: hidden;
        margin-bottom: 1rem; /* 增加卡片间距，提升可读性 */
    }
    .app-card-content {
        flex: 1;
        margin-bottom: 0;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
    }
    .app-card-info {
        margin-left: 0;
        text-align: left;
        min-width: 0;
    }
    .app-card-info h3 {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .app-card-info p {
        font-size: 0.75rem;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 0.5rem !important; /* 确保标签和描述间距合理 */
    }
    .app-card-button {
        width: auto;
        margin-top: 0;
        margin-left: 0.5rem;
        align-self: center;
        flex-shrink: 0; /* 防止按钮被挤压 */
    }
    .app-card-button button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: 90px;
        cursor: pointer;
    }
    .tag-style {
        font-size: 0.65rem;
        padding: 0.0625rem 0.375rem;
    }
    .rank-num {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.8rem;
    }

    /* 移动端分页按钮适配（已删除分页，保留样式备用） */
    .pagination-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    .inline-flex.rounded-md {
        flex-wrap: wrap;
        justify-content: center;
    }

    .inline-flex.rounded-md a,
    .inline-flex.rounded-md span {
        margin-bottom: 0.5rem;
    }

    footer .flex {
        flex-direction: column;
        text-align: center;
    }

    footer .flex.space-x-6 {
        margin-top: 1rem;
        justify-content: center;
    }

    .faq-item {
        padding: 1rem 0;
    }
}

/* 超小屏手机优化 - 重点适配 */
@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    .app-card {
        padding: 0.75rem 0.5rem; /* 进一步减小内边距 */
        gap: 0.5rem; /* 减小卡片内部间距 */
    }
    .text-lg {
        font-size: 0.95rem;
    }
    .text-2xl {
        font-size: 1.1rem;
    }
    .text-sm {
        font-size: 0.75rem;
    }
    .category-buttons button {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        font-size: 0.75rem;
        cursor: pointer;
    }
    header h1 {
        font-size: 1.25rem !important;
        text-align: center;
    }
    /* 超小屏按钮进一步缩小 */
    .app-card-button button {
        min-width: 80px;
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    /* 超小屏图标缩小 */
    .w-16 {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    /* 超小屏分页按钮适配（已删除分页，保留样式备用） */
    .pagination-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    /* 超小屏公告栏进一步优化 */
    .scroll-notice {
        min-width: 100% !important;
        margin-top: 0.5rem !important;
    }
}

/* 图标样式 */
.fa {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    width: 1em;
    text-align: center;
}

.fa-th-large:before { content: "≡"; }
.fa-search:before { content: "🔍"; }
.fa-plus:before { content: "+"; }
.fa-download:before { content: "↓"; }
.fa-check:before { content: "✓"; }
.fa-chevron-left:before { content: "‹"; }
.fa-chevron-right:before { content: "›"; }
.fa-weibo:before { content: "微博"; font-family: sans-serif; font-size: 0.8em; }
.fa-wechat:before { content: "微信"; font-family: sans-serif; font-size: 0.8em; }
.fa-twitter:before { content: "推特"; font-family: sans-serif; font-size: 0.8em; }
.fa-facebook:before { content: "FB"; font-family: sans-serif; font-size: 0.8em; }

/* 页脚底部文字居中样式 */
.footer-bottom-text {
    margin: 0;
    font-size: 0.8rem;
    color: #9CA3AF;
    text-align: center !important;
    width: 100%;
}
.footer-text {
    margin: 1rem 0 0 0;
    font-size: 0.85rem;
    color: #9CA3AF;
    text-align: center !important;
    width: 100%;
}
.footer-link {
    color: #FF7A00;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
    display: inline-block;
    font-size: 0.85rem;
}
.footer-link:hover {
    color: #ff9533;
}

/* SEO介绍板块样式 */
.intro-section {
    background: #fff;
    padding: 2rem 0;
    margin: 1.5rem 0;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}
.intro-title {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 700;
    color: #2A2A2A;
    margin-bottom: 1.2rem;
    text-align: center;
}
.intro-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
    color: #374151;
    padding: 0 1rem;
    font-size: 0.95rem;
}
.intro-content p {
    margin-bottom: 0.8rem;
}

/* SEO问答板块样式 */
.faq-section {
    background: #fff;
    padding: 2rem 1rem;
    margin: 1.5rem 0 0.5rem 0;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}
.faq-title {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 700;
    color: #2A2A2A;
    margin-bottom: 1.5rem;
    text-align: center;
}
.faq-list {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}
.faq-item {
    padding: 1.2rem 0;
    border-bottom: 1px solid #E5E7EB;
}
.faq-question {
    font-size: 1rem;
    font-weight: 600;
    color: #2A2A2A;
    margin-bottom: 0.6rem;
}
.faq-answer {
    color: #374151;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* 页脚同步调窄最大宽度 */
footer {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding-top: 2rem;
}

/* 删除下拉引导提示样式（已移除对应DOM） */
.pull-tips, .pull-icon {
    display: none !important;
}

/* 删除底部分页样式（已移除对应DOM） */
.bottom-pagination {
    display: none !important;
}