/* 源码集市页面样式 - 完全独立，不影响其他页面 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: "Microsoft YaHei", 微软雅黑; 
    font-size: 14px; 
    color: #333; 
    background: #f5f5f5; 
}

a { 
    color: #333; 
    text-decoration: none; 
}

a:hover { 
    color: #ff6b6b; 
}

ul { 
    list-style: none; 
}

/* 头部iframe */
.header-iframe {
    width: 100%;
    height: 214px;
    border: none;
    display: block;
}

/* 主体内容 */
.main-content {
    width: 1250px;
    margin: 20px auto;
    background: #fff;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

/* 筛选区域 */
.filter-box {
    padding: 0 30px;
    background: #fff;
}

/* 筛选头部 */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.filter-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-tabs a {
    font-size: 14px;
    color: #666;
    padding: 5px 10px;
}

.filter-tabs a.active {
    color: #ff6b6b;
    font-weight: bold;
}

.filter-tabs span {
    color: #ddd;
}

.filter-count {
    font-size: 14px;
    color: #999;
}

.filter-count span {
    color: #ff6b6b;
    font-weight: bold;
}

/* 筛选行 */
.filter-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
}

.filter-row:last-of-type {
    border-bottom: none;
}

.filter-label {
    width: 70px;
    color: #666;
    font-size: 14px;
    line-height: 28px;
    flex-shrink: 0;
}

/* 筛选选项 - 使用span包裹，固定宽度对齐 */
.filter-options {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
}

.filter-options span {
    display: inline-block;
    min-width: 110px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.filter-options a {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 20px;
    transition: all 0.2s;
    color: #333;
    white-space: nowrap;
}

.filter-options a:hover {
    color: #ff6b6b;
}

.filter-options a.active {
    color: #ff6b6b;
    background: #fff0f0;
}

/* 排序栏 */
.sort-bar {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.sort-options {
    display: flex;
    gap: 25px;
}

.sort-options a {
    color: #666;
    font-size: 14px;
    padding: 5px 0;
    position: relative;
}

.sort-options a:hover,
.sort-options a.active {
    color: #ff6b6b;
}

.sort-options a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #ff6b6b;
}

/* 价格筛选 */
.price-filter {
    display: flex;
    align-items: center;
    margin-left: 30px;
}

.price-input {
    width: 50px;
    height: 26px;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 12px;
    line-height: 26px;
}

.price-sep {
    color: #999;
    margin: 0 5px;
}

.price-btn {
    height: 26px;
    padding: 0 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 8px;
    line-height: 24px;
}

.price-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

/* 页码计数 */
.page-count {
    margin-left: auto;
    color: #999;
    font-size: 14px;
}

/* 商品列表 */
.goods-list {
    padding: 20px 30px;
}

.goods-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* 商品卡片 - 使用更高优先级避免被覆盖 */
.main-content .goods-item {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: all 0.3s !important;
    margin: 0 !important;
    padding: 0 !important;
}

.main-content .goods-item:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
    border-color: #ff6b6b !important;
}

.main-content .goods-item a {
    display: block !important;
    text-decoration: none !important;
}

.main-content .goods-img {
    width: 100% !important;
    height: 200px !important;
    overflow: hidden !important;
    background: #f8f8f8 !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.main-content .goods-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s !important;
    display: block !important;
}

.main-content .goods-item:hover .goods-img img {
    transform: scale(1.05) !important;
}

.main-content .goods-info {
    padding: 15px !important;
    background: #fff !important;
    text-align: left !important;
}

.main-content .goods-title {
    font-size: 14px !important;
    line-height: 20px !important;
    height: 40px !important;
    overflow: hidden !important;
    margin-bottom: 10px !important;
    color: #333 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    text-align: left !important;
}

.main-content .goods-price {
    color: #ff6b6b !important;
    font-size: 18px !important;
    font-weight: bold !important;
    margin-bottom: 8px !important;
    text-align: left !important;
}

.main-content .goods-shop {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 8px !important;
    font-size: 12px !important;
}

.main-content .shop-tag {
    padding: 2px 8px !important;
    border-radius: 3px !important;
    color: #fff !important;
    font-size: 12px !important;
    margin-right: 8px !important;
    display: inline-block !important;
}

.main-content .shop-tag.official { background: #ff6b6b !important; }
.main-content .shop-tag.flagship { background: #4ecdc4 !important; }
.main-content .shop-tag.self { background: #45b7d1 !important; }

.main-content .goods-tags {
    display: flex !important;
    gap: 5px !important;
    flex-wrap: wrap !important;
}

.main-content .goods-tags span {
    padding: 2px 8px !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    border: 1px solid !important;
    display: inline-block !important;
}

.main-content .tag-auto { color: #4ecdc4 !important; border-color: #4ecdc4 !important; }
.main-content .tag-manual { color: #999 !important; border-color: #999 !important; }
.main-content .tag-bond { color: #ff6b6b !important; border-color: #ff6b6b !important; }
.main-content .tag-install { color: #4ecdc4 !important; border-color: #4ecdc4 !important; }

/* 分页 */
.pagination {
    text-align: center;
    padding: 30px;
}

.pagination ul {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
}

.pagination ul li {
    display: inline-block;
}

.pagination ul li a,
.pagination ul li span {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination ul li a:hover {
    background: #ff6b6b;
    color: #fff;
    border-color: #ff6b6b;
}

.pagination ul li.active span {
    background: #ff6b6b;
    color: #fff;
    border-color: #ff6b6b;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state p {
    color: #999;
    font-size: 16px;
}

/* 底部 */
.footer {
    width: 100%;
    background: #333;
    color: #999;
    padding: 20px 0;
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
}

.footer a {
    color: #999;
    margin: 0 5px;
}

.footer a:hover {
    color: #fff;
}
