/* css/product.css */

/* --- 产品网格样式 --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.product-item {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    height: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.product-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    display: block;
    background-color: #f0f0e0;
}

.product-title {
    padding: 10px 12px;
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

/* --- 产品详情页容器 --- */
.product-detail-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.product-detail-container .rich-text-content {
    padding: 0 30px 30px;
}

.product-detail-container h1 {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #d9534f;
}

/* --- 粘性定位的样式 --- */
.sticky-product-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #ffffff;
    padding: 30px 30px 0 30px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #007bff;
    text-decoration: none;
}

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

/* --- 产品元信息框样式 --- */
.product-meta-info {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    background-color: #fafafa;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.meta-item {
    font-size: 14px;
    display: none;
    overflow-wrap: break-word;
}

.meta-label {
    font-weight: 500;
    color: #555;
    margin-right: 5px;
}

/* --- 下载按钮区域样式 (已修改) --- */
.download-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 修改：将分类容器改为 flex 布局 */
.download-category {
    display: flex;
    align-items: center; /* 垂直居中对齐标题和按钮 */
    flex-wrap: wrap;     /* 在小屏幕上允许换行 */
    gap: 10px;           /* 换行时的间距 */
}

/* 修改：调整标题样式以适应 flex 布局 */
.download-category-title {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    flex-shrink: 0;      /* 防止标题被压缩 */
    margin-right: 15px;  /* 标题和按钮之间的间距 */
}

.download-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.download-button-link {
    display: inline-block;
    padding: 10px 18px;
    font-size: 14px;
    text-align: center;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    color: #fff;
    transition: opacity 0.2s;
}
.download-button-link:hover {
    opacity: 0.85;
}
.btn-baidu { background-color: #2972f2; }
.btn-quark { background-color: #0c9f75; }
.btn-ctfile { background-color: #f16529; }
.btn-paid { background-color: #28a745; }


/* --- 系统配置要求样式 --- */
#system-req-section {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 20px 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

#system-req-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    font-size: 18px;
}

#system-req-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    color: #555;
}

#system-req-list li {
    padding: 8px 0;
    display: flex;
}

#system-req-list li:not(:last-child) {
    border-bottom: 1px solid #eee;
}

#system-req-list strong {
    color: #333;
    width: 80px;
    flex-shrink: 0;
    margin-right: 10px;
}

/* --- 搜索结果页网格布局修复 --- */
.search-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    justify-content: start;
}

/* --- 响应式调整 --- */
@media (max-width: 600px) {
    .meta-grid {
        grid-template-columns: 1fr;
    }
}