body {
    background: #f5f5f5;
}
main {
    max-width: var(--site-max-width);
    /* 与 demand-detail / demands-container 等与页脚间距一致（见 common.css --site-content-bottom-gap） */
    padding-bottom: var(--site-content-bottom-gap, 35px);
    box-sizing: border-box;
}
/* 响应式样式 - 搜索样式 */
.template-download-header {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 32px 24px 16px 24px;
    text-align: center;
    margin-top: 20px;
    display: inline-block;
}
.template-download-header h1 {
    font-size: 32px;
    color: #e53935;
    margin-bottom: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}
.template-search-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.template-search-bar input {
    width: 340px;
    height: 40px;
    border-radius: 20px 0 0 20px;
    border: 1px solid #eee;
    padding: 0 16px;
    font-size: 16px;
    outline: none;
    background: #fafafa;
}
.template-search-bar button {
    width: 48px;
    height: 40px;
    border-radius: 0 20px 20px 0;
    background: #e53935;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.template-search-bar button:hover {
    background: #c62828;
}
/* 响应式样式 - 搜索样式 */
@media (max-width: 1024px) {
.template-search-bar input {
    width: 100%;
}
}
/* 响应式样式 - 分类筛选栏 */
.template-categories {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 6px;
    padding: 12px 0 0 0;
}
.template-categories::-webkit-scrollbar {
    display: none;
}
.template-categories .category {
    color: #666;
    font-size: 15px;
    padding: 2px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    background: transparent;
    user-select: none;
    line-height: 28px;
}
.template-categories .category.active {
    color: #e53935;
    background: #ffeaea;
    font-weight: bold;
}
.template-categories .category:focus {
    outline: none;
}
.template-categories .category:focus-visible {
    outline: 2px solid #e53935;
    outline-offset: 2px;
}
.template-card[hidden] {
    display: none !important;
}
.template-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 16px;
    color: #888;
    font-size: 15px;
    margin: 0;
}


/* 模板网格 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 32px;
    width: 100%;
    margin: 32px 0 0;
    box-sizing: border-box;
}
.template-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.template-card:hover {
    box-shadow: 0 6px 24px rgba(229,57,53,0.10);
}
.template-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.template-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.mask {
    display: flex;
    align-items: center;
    justify-content: space-around;
    top: 0;
    left: 0;
    opacity: 0;
    transition: all 0.5s;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    position: absolute;
}
.btn-download {
    cursor: pointer;
    width: 100px;
    height: 40px;
    border-radius: 20px;
    text-align: center;
    background-color: #EF2237;
    color: #fff;
    line-height: 40px;
}
.template-grid .template-card:hover .mask {
    opacity: 1;
}

.template-title {
    text-align: center;
    font-size: 16px;
    color: #222;
    padding: 18px 0 12px 0;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
}

/* 响应式样式 - 模板网格：窄屏下用 main 水平内边距统一留白（与首页 section、顶栏 15px 一致），避免卡片区贴屏幕边缘 */
@media (max-width: 1024px) {
    main {
        padding-left: 15px;
        padding-right: 15px;
    }
    .template-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 768px) {
.template-grid {
    grid-template-columns: repeat(3, 1fr);
}
}
@media (max-width: 540px) {
.template-grid {
    grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 360px) {
.template-grid {
    grid-template-columns: repeat(1, 1fr);
}
}

