/* ==========================================================================
   增强布局系统 - 响应式适配和移动端优化
   补充 ilovefree-migration.css 的现代化布局功能
   ========================================================================== */

/* CSS变量扩展 */
:root {
    /* 响应式断点 */
    --breakpoint-xs: 480px;
    --breakpoint-sm: 768px;
    --breakpoint-md: 1024px;
    --breakpoint-lg: 1280px;
    --breakpoint-xl: 1536px;

    /* 移动端优化变量 */
    --mobile-padding: 1rem;
    --mobile-gap: 0.75rem;
    --mobile-radius: 12px;
    --mobile-font-size: 0.875rem;

    /* 容器最大宽度 */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1400px;

    /* 动画曲线 */
    --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* 阴影层次 */
    --shadow-card-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-card-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-card-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-card-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   现代化容器系统
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container-2xl);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
}

/* 响应式容器 */
@media (max-width: 1536px) {
    .container { max-width: var(--container-xl); }
}

@media (max-width: 1280px) {
    .container { max-width: var(--container-lg); }
}

@media (max-width: 1024px) {
    .container {
        max-width: var(--container-md);
        padding: 0 var(--space-md);
    }
}

@media (max-width: 768px) {
    .container {
        max-width: var(--container-sm);
        padding: 0 var(--mobile-padding);
    }
}

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

/* ==========================================================================
   现代化网格系统
   ========================================================================== */

.grid {
    display: grid;
    gap: var(--grid-gap, 1rem);
    grid-template-columns: var(--grid-cols, repeat(auto-fit, minmax(280px, 1fr)));
}

.grid-sm { --grid-cols: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-md { --grid-cols: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-lg { --grid-cols: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-xl { --grid-cols: repeat(auto-fit, minmax(350px, 1fr)); }

/* 特殊网格布局 */
.grid-2 { --grid-cols: repeat(2, 1fr); }
.grid-3 { --grid-cols: repeat(3, 1fr); }
.grid-4 { --grid-cols: repeat(4, 1fr); }
.grid-5 { --grid-cols: repeat(5, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4, .grid-5 {
        --grid-cols: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4, .grid-5 {
        --grid-cols: 1fr;
    }
}

/* ==========================================================================
   现代化Flexbox系统
   ========================================================================== */

.flex {
    display: flex;
    gap: var(--flex-gap, 1rem);
}

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

/* 对齐方式 */
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

/* ==========================================================================
   头部导航响应式优化
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s var(--ease-out-cubic);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    transition: transform 0.3s var(--ease-out-cubic);
    background: var(--ilovefree-gradient);
    color: var(--ilovefree-white);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.logo:hover .logo-img {
    transform: scale(1.05) rotate(2deg);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--ilovefree-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    flex: 1;
    max-width: 600px;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s var(--ease-out-cubic);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* background: var(--ilovefree-gradient); */
    opacity: 0;
    transition: opacity 0.3s var(--ease-out-cubic);
    z-index: -1;
}

.nav-link:hover {
    color: var(--ilovefree-white);
    transform: translateY(-2px);
}

.nav-link:hover::before {
    opacity: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle,
.search-toggle {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-cubic);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover,
.search-toggle:hover {
    background: var(--ilovefree-gradient);
    color: var(--ilovefree-white);
    transform: scale(1.1);
}

/* 移动端导航优化 */
@media (max-width: 768px) {
    .header-content {
        gap: 1rem;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        box-shadow: var(--shadow-card-xl);
        transition: left 0.3s var(--ease-out-cubic);
        z-index: 999;
        overflow-y: auto;
    }

    .main-nav.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        padding: 5rem 1rem 2rem;
        gap: 0.25rem;
    }

    .nav-link {
        padding: 1rem;
        justify-content: flex-start;
    }

    .nav-link span {
        font-size: 1rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    /* 移动端菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        cursor: pointer;
        position: relative;
        z-index: 1001;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--text-primary);
        margin: 5px auto;
        transition: all 0.3s var(--ease-out-cubic);
        border-radius: 2px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* ==========================================================================
   英雄区域响应式设计
   ========================================================================== */

.hero-section {
    padding: 4rem 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 600px;
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    transition: all 0.3s var(--ease-out-cubic);
}

.search-box:focus-within {
    border-color: var(--ilovefree-blue);
    box-shadow: 0 0 0 4px rgba(3, 150, 255, 0.1);
}

.search-icon {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    padding: 0.5rem 1.25rem;
    background: var(--ilovefree-gradient);
    color: var(--ilovefree-white);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-cubic);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(3, 150, 255, 0.3);
}

.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-elements {
    position: relative;
    width: 400px;
    height: 400px;
}

.float-element {
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--ilovefree-blue);
    animation: float 6s ease-in-out infinite;
}

.element-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.element-2 {
    top: 20%;
    right: 20%;
    animation-delay: 1s;
}

.element-3 {
    bottom: 30%;
    left: 15%;
    animation-delay: 2s;
}

.element-4 {
    bottom: 10%;
    right: 10%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* 移动端英雄区域 */
@media (max-width: 1024px) {
    .hero-section {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
        min-height: auto;
    }

    .hero-content {
        max-width: 100%;
        margin: 0 auto;
    }

    .hero-visual {
        order: -1;
    }

    .floating-elements {
        width: 300px;
        height: 300px;
    }

    .float-element {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .search-box {
        padding: 0.625rem 0.875rem;
    }

    .floating-elements {
        width: 250px;
        height: 250px;
    }

    .float-element {
        width: 50px;
        height: 50px;
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .search-box {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .search-btn {
        width: 100%;
        padding: 0.625rem;
    }

    .floating-elements {
        width: 200px;
        height: 200px;
    }
}

/* ==========================================================================
   内容区域响应式优化
   ========================================================================== */

.content-section {
    padding: 4rem 0;
}

.category-header {
    margin-bottom: 2rem;
}

.category-name {
    font-size: 2rem;
    font-weight: 700;
}


.tag-btn {
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
}

.nav-grid {
    gap: 1.5rem;
}

.nav-link {
    padding: 1.5rem;
}

.nav-link img {
    max-height: 140px;
}

.nav-link h4 {
    font-size: 1.125rem;
}

.nav-link p {
    font-size: 0.875rem;
}

/* 平板端优化 */
@media (max-width: 1024px) {
    .content-section {
        padding: 3rem 0;
    }

    .category-name {
        font-size: 1.75rem;
    }

    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.25rem;
    }

    .nav-link {
        padding: 1.25rem;
    }

    .nav-link img {
        max-height: 120px;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .content-section {
        padding: 2rem 0;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .category-line {
        display: none;
    }

    .category-name {
        font-size: 1.5rem;
    }

    .tags-container {
        margin-left: 0;
        align-self: stretch;
        margin-bottom: 1.5rem;
        gap: 0.5rem;
    }

    .tag-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }

    .tag-count {
        transform: scale(0.85);
    }

    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .nav-link {
        padding: 1rem;
    }

    .nav-link img {
        max-height: 100px;
    }

    .nav-link h4 {
        font-size: 1rem;
    }

    .nav-link p {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .content-section {
        padding: 1.5rem 0;
    }

    .category-header {
        margin: 1.5rem 0 0 0;
    }

    .category-name {
        font-size: 1.375rem;
    }

    .tags-container {
        margin: 1rem 0 1.25rem 0;
        gap: 0.375rem;
    }

    .tag-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .nav-link {
        padding: 0.75rem;
        min-height: 180px;
    }

    .nav-link img {
        max-height: 80px;
    }

    .nav-link h4 {
        font-size: 0.9375rem;
        margin: 0.375rem 0.125rem 0.125rem;
    }

    .nav-link p {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }

    .nav-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
        margin-top: 0.375rem;
    }
}

/* ==========================================================================
   页脚响应式设计
   ========================================================================== */

.site-footer {
    background: var(--gradient-bg);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s var(--ease-out-cubic);
}

.footer-links a:hover {
    color: var(--ilovefree-blue);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* 移动端页脚 */
@media (max-width: 768px) {
    .site-footer {
        padding: 2rem 0 1rem;
        margin-top: 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-bottom {
        padding-top: 1.5rem;
    }
}

/* ==========================================================================
   PickFree 5种显示样式系统
   ========================================================================== */

/* 样式基础变量 */
:root {
    /* 样式一 - 中等图片样式 */
    --style-1-image-height: 120px;
    --style-1-width: 20%;
    --style-1-grid-cols: repeat(auto-fill, minmax(180px, 1fr));

    /* 样式二 - 小图左布局 */
    --style-2-image-size: 36px;
    --style-2-width: 33.33%;
    --style-2-grid-cols: repeat(3, 1fr);

    /* 样式三 - 大图样式 */
    --style-3-image-height: 160px;
    --style-3-width: 33.33%;
    --style-3-grid-cols: repeat(auto-fill, minmax(280px, 1fr));

    /* 样式四 - 无图片文本布局 */
    --style-4-width: 25%;
    --style-4-grid-cols: repeat(4, 1fr);

    /* 样式五 - 小图下布局 */
    --style-5-image-height: 100px;
    --style-5-width: 25%;
    --style-5-grid-cols: repeat(4, 1fr);
}

/* 样式一：中等图片，下方显示名称、描述语和标签 (uk-width-medium-1-5) */
.nav-style-1 {
    grid-template-columns: var(--style-1-grid-cols);
}

.nav-style-1 .nav-link {
    text-align: center;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-style-1 .nav-link img {
    width: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.nav-style-1 .nav-link h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.nav-style-1 .nav-link p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    text-align: center;
    flex: 1;
}

.nav-style-1 .nav-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.nav-style-1 .nav-badge {
    background: var(--ilovefree-white);
    color: var(--ilovefree-gray);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 400;
    border: 1px solid var(--ilovefree-bg-light);
}

/* 样式二：小图在左，名称在右 (uk-width-medium-1-3 xiaotu) */
.nav-style-2 {
    grid-template-columns: var(--style-2-grid-cols);
}

.nav-style-2 .nav-link {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0.75rem 1rem !important;
    text-align: left !important;
    gap: 0.75rem !important;
    min-height: 60px;
}

.nav-style-2 .nav-link .nav-icon-wrapper {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.nav-style-2 .nav-link img {
    width: var(--style-2-image-size);
    height: var(--style-2-image-size);
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    margin: 0;
    order: 1; /* 确保图片在左边 */
    align-self: center; /* 垂直居中 */
    display: block !important;
}

.nav-style-2 .nav-link .nav-icon {
    font-size: var(--style-2-image-size) !important;
    width: var(--style-2-image-size) !important;
    height: var(--style-2-image-size) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 1; /* 确保图标在左边 */
    align-self: center !important;
}

.nav-style-2 .nav-link h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    line-height: 1.4;
    order: 2; /* 确保标题在右边 */
}

.nav-style-2 .nav-link p {
    display: none; /* 样式二不显示描述 */
}

.nav-style-2 .nav-badges {
    display: none; /* 样式二不显示标签 */
}

.nav-style-2 .nav-content {
    align-items: flex-start !important; /* 覆盖基础的 align-items: center */
}

.nav-style-2 .nav-title {
    text-align: left !important;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    line-height: 1.4;
    align-self: flex-start !important; /* 确保标题本身也左对齐 */
}

/* 样式三：大图，下方显示名称、描述语和标签 (uk-width-medium-1-3) */
.nav-style-3 {
    grid-template-columns: var(--style-3-grid-cols);
}

.nav-style-3 .nav-link {
    text-align: center;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-style-3 .nav-link img {
    width: 100%;
    height: var(--style-3-image-height);
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.nav-style-3 .nav-link h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0.75rem 0 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.nav-style-3 .nav-link p {
    font-size: 1rem;
    color: var(--text-secondary);
    /* margin: 0.5rem 0; */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    text-align: center;
    flex: 1;
}

.nav-style-3 .nav-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
}

.nav-style-3 .nav-badge {
    background: var(--ilovefree-white);
    color: var(--ilovefree-gray);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 400;
    border: 1px solid var(--ilovefree-bg-light);
}

/* 样式四：无图片，名称在左，描述语在右 (uk-width-medium-1-4 xiaotu) */
.nav-style-4 {
    grid-template-columns: var(--style-4-grid-cols);
}

.nav-style-4 .nav-link {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 1rem 1.25rem !important;
    text-align: left !important;
    gap: 0 !important;
    min-height: 80px;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    transform: translateY(0) !important;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    overflow: hidden !important;
    position: relative !important;
}

.nav-style-4 .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0396FF, #00D4FF) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.4s ease !important;
}

.nav-style-4 .nav-link:hover::before {
    transform: translateX(0) !important;
}

.nav-style-4 .nav-link img {
    display: none !important; /* 样式四不显示图片 */
}

.nav-style-4 .nav-link .nav-icon-wrapper {
    display: none !important; /* 样式四不显示图标容器 */
}

.nav-style-4 .nav-content {
    text-align: left !important;
    padding: 0 !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.5em !important;
    width: 100% !important;
}

.nav-style-4 .nav-title {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #1a202c !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    display: block !important;
    flex: 0 0 auto !important;
    min-width: fit-content !important;
    max-width: 180px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.nav-style-4 .nav-description {
    font-size: 0.8rem !important;
    color: #64748b !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    display: block !important;
    flex: 1 1 auto !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.nav-style-4 .nav-badges {
    display: none; /* 样式四不显示标签 */
}

/* 样式五：小图，下方显示名称、描述语和标签 (uk-width-medium-1-4 uk-grid-margin) */
.nav-style-5 {
    grid-template-columns: var(--style-5-grid-cols);
}

.nav-style-5 .nav-link {
    text-align: center;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* margin: 0.5rem 0; uk-grid-margin效果 */
    min-width: 0; /* 允许缩小以适应四列布局 */
}

.nav-style-5 .nav-link img {
    width: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.nav-style-5 .nav-link h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.nav-style-5 .nav-link p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    text-align: center;
    flex: 1;
}

.nav-style-5 .nav-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.nav-style-5 .nav-badge {
    background: var(--ilovefree-white);
    color: var(--ilovefree-gray);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 400;
    border: 1px solid var(--ilovefree-bg-light);
}

/* ==========================================================================
   响应式适配 - 5种样式的移动端优化
   ========================================================================== */

@media (max-width: 1024px) {
    /* 样式一适配 */
    .nav-style-1 {
        --style-1-grid-cols: repeat(auto-fill, minmax(160px, 1fr));
    }

    /* 样式二适配 - 在1024px以上保持3列布局 */
    .nav-style-2 {
        --style-2-grid-cols: repeat(3, 1fr);
    }

    /* 中等屏幕样式二特殊调整 */
    .nav-style-2 .nav-link {
        gap: 0.6rem !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    .nav-style-2 .nav-link .nav-icon-wrapper {
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .nav-style-2 .nav-link img {
        order: 1; /* 确保图片在左边 */
        align-self: center !important;
    }

    .nav-style-2 .nav-link .nav-icon {
        order: 1; /* 确保图标在左边 */
        align-self: center !important;
    }

    .nav-style-2 .nav-link h4 {
        order: 2; /* 确保标题在右边 */
    }

    .nav-style-2 .nav-content {
        align-items: flex-start !important;
    }

    .nav-style-2 .nav-title {
        text-align: left !important;
        order: 2; /* 确保标题在右边 */
        align-self: flex-start !important;
    }

    /* 样式三适配 */
    .nav-style-3 {
        --style-3-grid-cols: repeat(auto-fill, minmax(240px, 1fr));
    }

    /* 样式四适配 - 保持4列布局 */
    .nav-style-4 {
        --style-4-grid-cols: repeat(4, 1fr);
    }

    /* 样式五适配 - 保持四列布局 */
    .nav-style-5 {
        --style-5-grid-cols: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    /* 样式一、二、三、四在移动端统一为双列布局 */
    .nav-style-1,
    .nav-style-2,
    .nav-style-3,
    .nav-style-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* 样式五保持特殊的四列布局，但调整尺寸 */
    .nav-style-5 {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    /* 移动端样式五特殊调整 */
    .nav-style-5 .nav-link {
        padding: 0.75rem 0.5rem;
    }

    .nav-style-5 .nav-link h4 {
        font-size: 0.8rem;
    }

    .nav-style-5 .nav-link p {
        font-size: 0.7rem;
        -webkit-line-clamp: 1;
    }

    /* 移动端样式调整 */
    .nav-style-1 .nav-link img,
    .nav-style-3 .nav-link img,
    .nav-style-5 .nav-link img {
        height: 80px;
    }

    .nav-style-2 .nav-link {
        gap: 0.5rem !important;
        min-height: 50px !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    .nav-style-2 .nav-link .nav-icon-wrapper {
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .nav-style-2 .nav-link img {
        width: 32px;
        height: 32px;
        order: 1; /* 确保图片在左边 */
        align-self: center !important;
    }

    .nav-style-2 .nav-link .nav-icon {
        order: 1; /* 确保图标在左边 */
        align-self: center !important;
        font-size: 32px !important;
        width: 32px !important;
        height: 32px !important;
    }

    .nav-style-2 .nav-link h4 {
        order: 2; /* 确保标题在右边 */
    }

    .nav-style-2 .nav-content {
        align-items: flex-start !important;
    }

    .nav-style-2 .nav-title {
        text-align: left !important;
        order: 2; /* 确保标题在右边 */
        align-self: flex-start !important;
    }

    .nav-style-1 .nav-link h4,
    .nav-style-3 .nav-link h4,
    .nav-style-4 .nav-link h4,
    .nav-style-5 .nav-link h4 {
        font-size: 0.9rem;
    }

    .nav-style-2 .nav-link h4 {
        font-size: 0.875rem;
    }

    .nav-style-1 .nav-link p,
    .nav-style-3 .nav-link p,
    .nav-style-4 .nav-link p,
    .nav-style-5 .nav-link p {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }

    .nav-style-4 .nav-link {
        padding: 0.75rem !important;
        min-height: 60px !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5em !important;
    }

    .nav-style-4 .nav-link h4 {
        min-width: 100px !important;
        max-width: 120px !important;
        font-size: 1rem !important;
        order: 1 !important;
    }

    .nav-style-4 .nav-link p {
        font-size: 0.8rem !important;
        order: 2 !important;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕样式一、二、三、四单列布局 */
    .nav-style-1,
    .nav-style-2,
    .nav-style-3,
    .nav-style-4 {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* 样式五在超小屏幕保持双列布局 */
    .nav-style-5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    /* 超小屏幕图片尺寸调整 */
    .nav-style-1 .nav-link img,
    .nav-style-3 .nav-link img,
    .nav-style-5 .nav-link img {
        height: 60px;
    }

    .nav-style-2 .nav-link {
        gap: 0.5rem !important;
        min-height: 45px !important;
        padding: 0.5rem 0.75rem !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    .nav-style-2 .nav-link .nav-icon-wrapper {
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .nav-style-2 .nav-link img {
        width: 28px;
        height: 28px;
        order: 1; /* 确保图片在左边 */
        align-self: center !important;
    }

    .nav-style-2 .nav-link .nav-icon {
        order: 1; /* 确保图标在左边 */
        align-self: center !important;
        font-size: 28px !important;
        width: 28px !important;
        height: 28px !important;
    }

    .nav-style-2 .nav-link h4 {
        order: 2; /* 确保标题在右边 */
    }

    .nav-style-2 .nav-content {
        align-items: flex-start !important;
    }

    .nav-style-2 .nav-title {
        text-align: left !important;
        order: 2; /* 确保标题在右边 */
        align-self: flex-start !important;
    }

    /* 内边距调整 */
    .nav-style-1 .nav-link,
    .nav-style-3 .nav-link,
    .nav-style-5 .nav-link {
        padding: 0.5rem;
    }

    .nav-style-2 .nav-link {
        padding: 0.5rem 0.75rem;
    }

    .nav-style-4 .nav-link {
        padding: 0.5rem 0.75rem !important;
        min-height: 50px !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5em !important;
    }

    .nav-style-4 .nav-link h4 {
        min-width: 80px !important;
        max-width: 100px !important;
        font-size: 0.9rem !important;
        order: 1 !important;
    }

    .nav-style-4 .nav-link p {
        font-size: 0.75rem !important;
        order: 2 !important;
    }
}

/* ==========================================================================
   性能优化和动画增强
   ========================================================================== */

/* 硬件加速 */
.category-header,
.tags-container,
.nav-link,
.nav-link,
.hero-content,
.floating-elements {
    will-change: transform;
}

/* 图片懒加载优化 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s var(--ease-out-cubic);
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* 减少动画对性能的影响 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --bg-glass: rgba(15, 23, 42, 0.8);
        --bg-glass-hover: rgba(15, 23, 42, 0.9);
    }

    .site-header {
        background: rgba(15, 23, 42, 0.95);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-nav {
        background: rgba(15, 23, 42, 0.98);
    }
}

/* 触摸设备优化 */
@media (hover: none) {
    .nav-link:hover,
    .tag-btn:hover,
    .search-btn:hover {
        transform: none;
    }

    .nav-link:active,
    .tag-btn:active,
    .search-btn:active {
        transform: scale(0.95);
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .nav-link {
        border: 2px solid var(--text-primary);
    }

    .tag-btn {
        border: 2px solid currentColor;
    }
}

/* 打印样式优化 */
@media print {
    .site-header,
    .hero-section,
    .site-footer,
    .floating-elements,
    .search-container {
        display: none;
    }

    .content-section {
        padding: 1rem 0;
        break-inside: avoid;
    }

    .nav-link {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid #ccc;
    }

    .nav-link {
        background: white;
        box-shadow: none;
        border: none;
    }

    .category-name {
        color: #000;
    }
}