/* =================================================================
   主样式表 (Main Stylesheet)
   ================================================================= */
/* 新增：定义本地字体 */
@font-face {
  font-family: 'Alimama DongFang DaKai';
  src: url('../fonts/alimama/AlimamaDongFangDaKai-Regular.woff2') format('woff2'),
       url('../fonts/alimama/AlimamaDongFangDaKai-Regular.woff') format('woff'),
       url('../fonts/alimama/AlimamaDongFangDaKai-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
/* 1. 全局重置与盒模型 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 2. 根元素与字体 */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Arial", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.4;
    background-color: #f8f8fa;
    color: #333;
}

/* 3. 布局容器 */
.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 18px;
    padding-right: 18px;
}

/* 4. 站点头部 */
.site-header {
    padding: 15px 0; /* 可以微调内边距以适应Logo高度 */
}

.site-header .logo a {
    display: inline-block; /* 确保链接大小能包裹图片 */
    vertical-align: middle;
}

/* 新增：控制Logo图片大小 */
.site-header .logo .logo-image {
    height: 40px; /* 设定Logo的高度，例如40像素 */
    width: auto; /* 宽度自动调整以保持原始宽高比 */
    display: block; /* 移除图片底部可能出现的空白间隙 */
}
/* 5. 首页 Hero 区域 */
.hero {
    text-align: center;
    padding: 60px 0;
}

.hero h1 {
    /* 将新字体应用在最前面 */
    font-family: 'Alimama DongFang DaKai', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 28px; /* 艺术字体通常需要稍大一些才好看 */
    font-weight: normal; /* 许多艺术字体本身就带有粗细，无需额外加粗 */
    margin-bottom: 8px;
}
.hero p {
    font-size: 18px;
    color: #666;
}

/* 6. 站点页脚 */
.site-foot {
    text-align: center;
    padding: 40px 0;
    font-size: 14px;
    color: #888;
}

.site-foot a {
    color: #666;
    text-decoration: none;
}

.site-foot a:hover {
    text-decoration: underline;
}

/* 7. 壁纸网格 (Wallpaper Grid) */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding-bottom: 40px;
    align-items: start; 
}

.wallpaper-item {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wallpaper-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.wallpaper-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.wallpaper-item:hover img {
    transform: scale(1.05);
}

/* 8. 壁纸详情页 (Wallpaper Details) */
.wallpaper-details {
    max-width: 720px;
    margin: 20px auto 40px;
}

.wallpaper-preview {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.wallpaper-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.wallpaper-actions {
    padding: 24px 0;
    display: flex;
    justify-content: center;
}

/* 9. 创意悬停下载按钮 (Creative Hover Button) */
.creative-download-btn {
    position: relative;
    cursor: pointer;
    padding: 12px;
    width: 180px;
    border: 1px solid #e5e7eb;
    background-color: white;
    border-radius: 9999px;
    overflow: hidden;
    color: black;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.4s ease;
}

.creative-download-btn .initial-text {
    display: inline-block;
    transition: all 0.3s ease;
}

.creative-download-btn:hover .initial-text {
    transform: translateX(100px);
    opacity: 0;
}

.creative-download-btn .hover-text {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 10;
    display: flex;
    gap: 8px;
    color: white;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transform: translate(-50%, -50%) translateX(-100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.creative-download-btn:hover .hover-text {
    transform: translate(-50%, -50%) translateX(0);
    opacity: 1;
}

.creative-download-btn .background-circle {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: #007aff;
    transform: scale(0);
    border-radius: 9999px;
    transition: all 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.creative-download-btn:hover .background-circle {
    transform: scale(1);
}

/* =================================================================
   10. 加载更多按钮 (Load More Button)
   ================================================================= */

.load-more-container {
    text-align: center;
    /* 居中内部的按钮 */
    padding: 20px 0 40px;
    /* 按钮的上下留白 */
}

.load-more-btn {
    cursor: pointer;
    border: 2px solid #007aff;
    /* 使用主题高光蓝色作为轮廓 */
    background-color: transparent;
    color: #007aff;
    /* 文字颜色与轮廓相同 */
    padding: 10px 28px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 30px;
    /* 胶囊形状 */
    transition: all 0.2s ease-in-out;
}

/* 鼠标悬浮效果 */
.load-more-btn:hover {
    background-color: #007aff;
    /* 背景填充为高光蓝 */
    color: #fff;
    /* 文字变为白色 */
}

/* 按钮禁用时的样式，JS 将在没有更多内容时使用 */
.load-more-btn:disabled {
    cursor: not-allowed;
    background-color: #e9e9eb;
    border-color: #e9e9eb;
    color: #8e8e93;
}
/* =================================================================
   11. 壁纸标签 (Tag Pills)
   ================================================================= */

.wallpaper-tags {
    display: flex;
    flex-wrap: wrap; /* 标签过多时可换行 */
    justify-content: center;
    gap: 10px; /* 标签之间的间距 */
    padding: 24px 0;
}

.tag-pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px; /* 胶囊形状 */
    background-color: #e9e9eb; /* 苹果风格的浅灰色 */
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.tag-pill:hover {
    background-color: #dcdce1; /* 悬浮时颜色加深 */
}
/* =================================================================
   12. 首页标签筛选栏 (Homepage Filter Bar)
   ================================================================= */

.filter-bar-container {
    margin-bottom: 30px;
}

.filter-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto; /* 在移动端或内容过多时，允许水平滚动 */
    padding-bottom: 15px; /* 为滚动条留出空间，避免遮挡 */
    -webkit-overflow-scrolling: touch; /* 在 iOS 上实现平滑滚动 */
}

/* 隐藏滚动条，但保留滚动功能，实现苹果风格的简洁外观 */
.filter-bar::-webkit-scrollbar {
    display: none;
}
.filter-bar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.filter-tag {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    background-color: #e9e9eb;
    color: var(--apple-font-color);
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap; /* 确保标签文字不换行 */
    transition: all 0.2s ease-in-out;
    user-select: none; /* 防止用户意外选中文本 */
}

.filter-tag:hover {
    background-color: #dcdce1;
}

/* 标签被选中时的“激活”样式 */
.filter-tag.active {
    background-color: var(--apple-blue);
    color: #fff;
    font-weight: 600;
}
/* =================================================================
   13. 详情页导航箭头 (Details Page Navigation)
   ================================================================= */

.wallpaper-preview {
    position: relative; /* 为内部绝对定位的箭头提供基准 */
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    padding: 15px;
    border-radius: 50%;
    width: 24px; /* 固定宽度 */
    height: 24px; /* 固定高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, opacity 0.3s ease;
    opacity: 0; /* 默认隐藏 */
}

/* 鼠标悬浮在整个预览区域时，显示箭头 */
.wallpaper-preview:hover .nav-arrow {
    opacity: 1;
}

.nav-arrow.prev {
    left: 15px;
}

.nav-arrow.next {
    right: 15px;
}

.nav-arrow:hover {
    background-color: rgba(0, 0, 0, 0.5);
}
/* =================================================================
   14. 返回链接 (Back Link)
   ================================================================= */

.back-link-container {
    margin-bottom: 16px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--apple-blue);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

.back-link .arrow {
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}