/* ========================================
   字体站 - 高级感浅色主题
   ======================================== */

/* CSS 变量 - 高级配色方案 */
:root {
    /* 主色调 - 优雅靛蓝紫 */
    --primary: #4b5563;
    --primary-dark: #111827;
    --primary-light: #9ca3af;
    --primary-bg: rgba(15, 23, 42, 0.06);
    
    /* 辅助色 */
    --accent: #f97316;
    --success: #22c55e;
    --info: #0ea5e9;
    --warning: #facc15;
    
    /* 背景色 */
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --bg-hover: #f9fafb;
    --bg-active: #e5e7eb;
    
    /* 文字色 - 层次分明 */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-light: #f9fafb;
    
    /* 边框 */
    --border: #e5e7eb;
    --border-light: #e5e7eb;
    --border-focus: #4b5563;
    
    /* 阴影 - 更有层次 */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.12);
    --shadow-primary: 0 4px 16px rgba(15, 23, 42, 0.25);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    --gradient-card: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

/* 重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    background: var(--bg-body) !important;
    min-height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    padding-top: 65px;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; font-family: inherit; }
.hidden { display: none !important; }

/* ========================================
   头部导航
   ======================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-xs);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.site-logo img {
    height: 32px;
    width: auto;
}

/* 分类导航容器 */
.header-category-nav-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-category-nav-wrapper::before,
.header-category-nav-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s;
}

.header-category-nav-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary), transparent);
}

.header-category-nav-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary), transparent);
}

.header-category-nav-wrapper.can-scroll-left::before,
.header-category-nav-wrapper.can-scroll-right::after {
    opacity: 1;
}

/* 分类导航 */
.header-category-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 4px 0;
}

.header-category-nav::-webkit-scrollbar {
    display: none;
}

.category-tab, .home-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-tab:hover, .home-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.category-tab.active, .home-tab.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

/* 搜索框 */
.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    width: 200px;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.header-search input:focus {
    border-color: var(--primary);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search .search-btn {
    padding: 8px 18px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s;
    box-shadow: var(--shadow-sm);
}

.header-search .search-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary);
}

/* ========================================
   主内容区
   ======================================== */
.font-main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 130px);
}

/* ========================================
   热门/最新展示区
   ======================================== */
.font-showcase {
    margin-bottom: 32px;
}

.showcase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.showcase-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.showcase-icon {
    font-size: 22px;
}

.showcase-more {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.showcase-more:hover {
    color: var(--primary-dark);
}

.showcase-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.showcase-scroll::-webkit-scrollbar {
    height: 6px;
}

.showcase-scroll::-webkit-scrollbar-track {
    background: var(--border-light);
    border-radius: 3px;
}

.showcase-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.showcase-scroll::-webkit-scrollbar-thumb:hover {
    background: #c1c1c1;
}

/* 展示区卡片 */
.showcase-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xs);
}

.showcase-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.showcase-card-preview {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 16px;
    position: relative;
}

.showcase-card-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.showcase-card-preview-text {
    font-size: 22px;
    color: #f1f5f9;
    font-weight: 500;
}

.showcase-card-license {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.showcase-card-info {
    padding: 12px;
    text-align: center;
}

.showcase-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skeleton-card-mini {
    flex: 0 0 200px;
    height: 140px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* 全部字体标题 */
.section-title-main {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.font-list-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

/* 字体网格 */
.font-grid-wide,
#software-list-container.font-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ========================================
   字体卡片
   ======================================== */
.font-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xs);
}

.font-card:hover {
    border-color: var(--primary);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

/* 字体预览区域 */
.font-card-preview {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 24px;
    position: relative;
}

.font-card-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.font-card:hover .font-card-preview::after {
    opacity: 1;
}

.font-card-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.font-card-preview-text {
    font-size: 28px;
    color: #f1f5f9;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* 授权标签 - 左上角 */
.font-card-license {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 免费商用 - 绿色 */
.font-card-license.license-commercial {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

/* 个人免费 - 蓝色 */
.font-card-license.license-personal {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
}

/* 开源 - 紫色 */
.font-card-license.license-opensource {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
}

/* 默认 - 灰色 */
.font-card-license.license-default {
    background: rgba(255, 255, 255, 0.9);
    color: #475569;
}

/* 字体信息区域 */
.font-card-info {
    padding: 18px 20px 22px;
    text-align: center;
    background: var(--gradient-card);
}

.font-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* 加载更多按钮 */
.load-more-btn {
    grid-column: 1 / -1;
    padding: 14px 32px;
    background: var(--primary);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
}

.load-more-btn:hover {
    background: var(--primary-dark);
    border-color: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.load-more-btn .page-info {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 8px;
}

/* ========================================
   底部
   ======================================== */
.site-footer {
    padding: 40px 24px;
    background: linear-gradient(180deg, var(--bg-card) 0%, #f8f9fb 100%);
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0.3px;
    margin: 0;
}

.footer-links {
    margin-top: 12px;
    font-size: 12px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-sep {
    color: var(--border);
    margin: 0 8px;
}

/* ========================================
   骨架屏
   ======================================== */
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-lg);
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* ========================================
   动画
   ======================================== */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   返回顶部按钮
   ======================================== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 1200px) {
    .font-grid-wide,
    #software-list-container.font-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 移动端菜单按钮 - 默认隐藏 */
.mobile-menu-btn {
    display: none;
}

.mobile-menu {
    display: none;
}

@media (max-width: 900px) {
    /* 移动端 body padding */
    body {
        padding-top: 60px;
    }
    
    /* 移动端头部 */
    .header-container {
        justify-content: space-between;
        padding: 12px 16px;
    }
    
    /* Logo */
    .site-logo {
        font-size: 16px;
    }
    
    .site-logo img {
        height: 28px;
    }
    
    /* 隐藏 PC 端分类导航和搜索框 */
    .header-category-nav,
    .header-search {
        display: none;
    }
    
    /* 显示移动端菜单按钮 */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg-hover);
        border: 1px solid var(--border);
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .mobile-menu-btn:hover,
    .mobile-menu-btn.active {
        background: var(--primary);
        border-color: var(--primary);
    }
    
    .mobile-menu-btn:hover .menu-icon,
    .mobile-menu-btn:hover .menu-icon::before,
    .mobile-menu-btn:hover .menu-icon::after,
    .mobile-menu-btn.active .menu-icon,
    .mobile-menu-btn.active .menu-icon::before,
    .mobile-menu-btn.active .menu-icon::after {
        background: #fff;
    }
    
    /* 汉堡图标 */
    .menu-icon {
        position: relative;
        width: 18px;
        height: 2px;
        background: var(--text-primary);
        border-radius: 2px;
        transition: all 0.3s;
    }
    
    .menu-icon::before,
    .menu-icon::after {
        content: '';
        position: absolute;
        left: 0;
        width: 18px;
        height: 2px;
        background: var(--text-primary);
        border-radius: 2px;
        transition: all 0.3s;
    }
    
    .menu-icon::before {
        top: -6px;
    }
    
    .menu-icon::after {
        top: 6px;
    }
    
    /* 菜单打开时的 X 图标 */
    .mobile-menu-btn.active .menu-icon {
        background: transparent;
    }
    
    .mobile-menu-btn.active .menu-icon::before {
        top: 0;
        transform: rotate(45deg);
        background: #fff;
    }
    
    .mobile-menu-btn.active .menu-icon::after {
        top: 0;
        transform: rotate(-45deg);
        background: #fff;
    }
    
    /* 移动端下拉菜单 */
    .mobile-menu {
        display: none;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding: 12px 16px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .mobile-menu.open {
        display: block;
        animation: slideDown 0.25s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* 移动端导航项 */
    .mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .mobile-nav-item {
        display: block;
        padding: 12px 16px;
        font-size: 14px;
        color: var(--text-secondary);
        background: var(--bg-hover);
        border-radius: 10px;
        text-decoration: none;
        transition: all 0.2s;
    }
    
    .mobile-nav-item:hover,
    .mobile-nav-item.active {
        background: var(--primary);
        color: #fff;
    }
}

@media (max-width: 768px) {
    .font-main-container {
        padding: 16px;
    }
    
    .font-list-section {
        padding: 16px;
    }
    
    .font-grid-wide,
    #software-list-container.font-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .font-card-preview {
        height: 100px;
    }
    
    /* 热门/最新展示区移动端 */
    .font-showcase {
        margin-bottom: 24px;
    }
    
    .showcase-title {
        font-size: 16px;
    }
    
    .showcase-card {
        flex: 0 0 160px;
    }
    
    .showcase-card-preview {
        height: 80px;
    }
    
    .skeleton-card-mini {
        flex: 0 0 160px;
        height: 120px;
    }
    
    .section-title-main {
        font-size: 16px;
        margin-bottom: 16px;
    }
}

/* ========================================
   滚动条
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--border);
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

