/* ============================================================
 * 浩创云 - 源码集市分类模板样式
 * ============================================================ */

.hcy-market-body { background: #f5f7fa; color: #333; font-family: "Microsoft YaHei","PingFang SC","Helvetica Neue",Helvetica,Arial,sans-serif; }
.hcy-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== Hero 区域 ===== */
.sm-header-hero { background: linear-gradient(135deg, #4F87FF 0%, #0066FF 100%); padding: 40px 0 30px; color: #fff; }
.sm-hero-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.sm-hero-text { flex: 1; min-width: 280px; }
.sm-hero-title { font-size: 32px; font-weight: 700; margin: 0 0 8px; }
.sm-hero-subtitle { font-size: 15px; opacity: 0.9; margin: 0 0 12px; }
.sm-hero-banner-text { font-size: 13px; opacity: 0.9; margin: 0; letter-spacing: 2px; background: rgba(255,255,255,0.18); display: inline-block; padding: 6px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.3); }
.sm-hero-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; min-width: 400px; background: rgba(255,255,255,0.15); border-radius: 10px; padding: 14px 18px; border: 1px solid rgba(255,255,255,0.25); }
.sm-stat-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sm-stat-icon { font-size: 18px; }
.sm-stat-text { line-height: 1.4; }

/* ===== 布局 ===== */
.sm-layout { display: flex; gap: 20px; margin: 20px auto; }
.sm-main { flex: 1; min-width: 0; }

/* ===== 搜索和排序 ===== */
.sm-hot-tabs { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.sm-search-group { display: flex; }
.sm-search-form { display: flex; }
.sm-search-input { height: 38px; padding: 0 14px; border: 1px solid #ddd; border-radius: 6px 0 0 6px; font-size: 14px; outline: none; width: 220px; }
.sm-search-input:focus { border-color: #4F87FF; }
.sm-search-btn { height: 38px; padding: 0 16px; background: #4F87FF; color: #fff; border: none; border-radius: 0 6px 6px 0; cursor: pointer; font-size: 14px; white-space: nowrap; }
.sm-search-btn:hover { background: #3b6fd4; }
.sm-sort-group { display: flex; align-items: center; gap: 6px; }
.sm-sort-label { font-size: 13px; color: #888; }
.sm-sort-link { font-size: 13px; padding: 5px 12px; color: #666; text-decoration: none; border-radius: 4px; transition: all 0.15s; }
.sm-sort-link:hover { color: #4F87FF; background: #f0f5ff; }
.sm-sort-link.sm-sort-active { color: #fff; background: #4F87FF; font-weight: 600; }

/* ===== 筛选面板 ===== */
.sm-filter-panel { background: #fff; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; }
.sm-filter-row { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f0f0f0; gap: 10px; }
.sm-filter-row:last-child { border-bottom: none; }
/* 子分类独立面板 */
.sm-subcate-panel { background: #fff; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); padding: 14px 16px; }
.sm-subcate-title { font-size: 13px; color: #666; font-weight: 600; margin-bottom: 10px; }
.sm-subcate-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-subcate-link { border: 1px solid #e0e0e0 !important; background: #fff !important; }
.sm-subcate-link:hover { background: #fff3f0 !important; border-color: #FF6B35 !important; color: #FF6B35 !important; }
.sm-filter-row-tags { display: flex; }
.sm-filter-label { flex-shrink: 0; width: 80px; font-size: 13px; color: #666; font-weight: 600; }
.sm-filter-options { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-items: center; }
.sm-filter-link { font-size: 12px; padding: 4px 10px; border-radius: 4px; background: #f5f5f5; color: #666; text-decoration: none; transition: all 0.15s; display: inline-block; white-space: nowrap; }
.sm-filter-link:hover { color: #4F87FF; background: #f0f5ff; }
.sm-filter-link.sm-filter-active { color: #fff; background: #4F87FF; font-weight: 600; }
.sm-tag-hidden { display: none; }
.sm-filter-more, .sm-filter-collapse { cursor: pointer; font-size: 12px; color: #4F87FF; padding: 4px 10px; display: inline-block; border-radius: 4px; border: 1px dashed #4F87FF; white-space: nowrap; }
.sm-filter-more:hover, .sm-filter-collapse:hover { background: #f0f5ff; text-decoration: none; }

/* 桌面端/手机端标签隐藏 */
@media (min-width: 769px) {
    .sm-tag-hidden-desktop { display: none !important; }
    .sm-filter-more-mobile { display: none !important; }
}
@media (max-width: 768px) {
    .sm-tag-hidden-mobile { display: none !important; }
    .sm-filter-more-desktop { display: none !important; }
}

/* ===== 商品网格 ===== */
.sm-product-grid { display: grid; gap: 15px; }
.sm-cols-2 { grid-template-columns: repeat(2,1fr); }
.sm-cols-3 { grid-template-columns: repeat(3,1fr); }
.sm-cols-4 { grid-template-columns: repeat(4,1fr); }
.sm-cols-5 { grid-template-columns: repeat(5,1fr); }
.sm-shadow-on .sm-product-card { box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.sm-product-card { background: #fff; border-radius: 8px; overflow: hidden; transition: transform 0.2s,box-shadow 0.2s; border: 1px solid #f0f0f0; display: flex; flex-direction: column; }
.sm-product-card:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.sm-card-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit; }
.sm-card-thumb { position: relative; overflow: hidden; background: #f5f5f5; }
.sm-card-thumb img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.sm-product-card:hover .sm-card-thumb img { transform: scale(1.05); }
.sm-card-free-badge { position: absolute; top: 8px; left: 8px; background: #4F87FF; color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.sm-card-title { font-size: 14px; font-weight: 600; color: #222; margin: 10px 12px 6px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sm-card-desc { font-size: 12px; color: #999; padding: 0 12px 6px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-card-bottom { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 12px; gap: 8px; margin-top: auto; }
.sm-card-price { font-size: 18px; font-weight: 700; color: #4F87FF; flex-shrink: 0; }
.sm-price-symbol { font-size: 13px; font-weight: 500; }
.sm-price-free { color: #52c41a; }
.sm-card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #aaa; }
.sm-card-views { color: #aaa; white-space: nowrap; }
.sm-card-demo { padding: 3px 10px; background: #f0f5ff; color: #4F87FF; border-radius: 4px; font-size: 11px; text-decoration: none; white-space: nowrap; transition: background 0.2s; }
.sm-card-demo:hover { background: #d8e4ff; text-decoration: none; }
.sm-style-card .sm-product-card { border-radius: 12px; }
.sm-style-card .sm-card-thumb { border-radius: 12px 12px 0 0; }
.sm-style-list .sm-product-card { display: flex; flex-direction: row; }
.sm-style-list .sm-card-thumb { width: 200px; height: 130px; flex-shrink: 0; padding-bottom: 0 !important; }
.sm-style-list .sm-card-title { padding-top: 14px; }
.sm-style-list .sm-card-link { display: flex; }
.sm-style-mini .sm-card-title { font-size: 13px; padding: 8px 10px 2px; }
.sm-style-mini .sm-card-bottom { padding: 2px 10px 8px; }
.sm-style-mini .sm-card-price { font-size: 15px; }
.sm-empty { text-align: center; padding: 60px 20px; color: #aaa; font-size: 15px; }

/* ===== 分页 ===== */
.sm-pagebar { display: flex; justify-content: center; align-items: center; gap: 4px; margin: 25px 0 40px; flex-wrap: nowrap; }
.sm-page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; font-size: 13px; border: 1px solid #e0e0e0; border-radius: 6px; text-decoration: none; color: #555; background: #fff; transition: all 0.15s; }
.sm-page-btn:hover { border-color: #4F87FF; color: #4F87FF; }
.sm-page-active { background: #4F87FF; border-color: #4F87FF; color: #fff; font-weight: 600; }
.sm-page-active:hover { color: #fff; }
.sm-page-disabled { color: #ccc; cursor: default; pointer-events: none; }
.sm-page-info { font-size: 12px; color: #aaa; margin-left: 12px; }
@media (max-width: 480px) {
    .sm-pagebar { gap: 2px; flex-wrap: wrap; }
    .sm-page-btn { min-width: 28px; height: 30px; padding: 0 5px; font-size: 12px; border-radius: 4px; }
    .sm-page-info { font-size: 11px; margin-left: 0; flex-basis: 100%; text-align: center; margin-top: 6px; }
}

/* ===== 侧边栏 ===== */
.sm-sidebar { width: 300px; flex-shrink: 0; }
.sm-sidebar-box { background: #fff; border-radius: 8px; border: 1px solid #eef0f3; padding: 16px; margin-bottom: 15px; }
.sm-sidebar-title { font-size: 15px; font-weight: 600; color: #222; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }
.sm-rank-list { list-style: none; padding: 0; margin: 0; }
.sm-rank-list li { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid #f8f8f8; }
.sm-rank-list li:last-child { border-bottom: none; }
.sm-rank-num { width: 22px; height: 22px; border-radius: 4px; background: #f0f0f0; color: #999; font-size: 12px; text-align: center; line-height: 22px; flex-shrink: 0; margin-right: 10px; font-weight: 600; }
.sm-rank-top { background: #4F87FF; color: #fff; }
.sm-rank-title { flex: 1; font-size: 13px; color: #333; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-rank-title:hover { color: #4F87FF; }
.sm-rank-price { font-size: 13px; color: #4F87FF; font-weight: 600; margin-left: 8px; flex-shrink: 0; }
.sm-service-box { }
.sm-service-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.sm-service-item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 12px; color: #666; background: #f9fafb; border-radius: 6px; }
.sm-service-icon { font-size: 16px; }
.sm-service-text { line-height: 1.4; }

/* ===== 广告位 ===== */
.sm-ad-top { margin-bottom: 15px; }
.sm-ad-bottom { margin-top: 0; }
.sm-ad-sidebar { margin-bottom: 15px; }

/* ===== 友情链接 ===== */
.hcy-friendly-links { padding: 20px 0 40px; }
.hcy-friendly-links-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hcy-friendly-links-label { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 10px; }
.hcy-friendly-links-list { display: flex; flex-wrap: wrap; gap: 10px; }
.hcy-friendly-links-list a { font-size: 13px; color: #666; text-decoration: none; }
.hcy-friendly-links-list a:hover { color: #4F87FF; }

/* ===== applicable icons ===== */
.hcy-code-applicable-icon { width: 24px; height: 24px; object-fit: contain; }
.hcy-code-applicable-icon-text { font-size: 12px; color: #666; }
.hcy-code-seller-contact-info { margin: 15px 0; padding: 15px; }

/* ===== 有图列表模式 ===== */
.sm-list-container { display: flex; flex-direction: column; gap: 8px; background: transparent; }
.sm-list-item { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: all 0.25s ease; }
.sm-list-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.08); transform: translateY(-1px); }
.sm-list-link { display: flex; align-items: stretch; text-decoration: none; color: inherit; }
.sm-list-pic .sm-list-link { gap: 0; }
.sm-list-thumb { flex-shrink: 0; width: 130px; min-height: 100px; position: relative; background: #f5f5f5; overflow: hidden; }
.sm-list-thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; transition: transform 0.3s; }
.sm-list-item:hover .sm-list-thumb img { transform: scale(1.05); }
.sm-list-badge { position: absolute; top: 5px; left: 5px; background: #4F87FF; color: #fff; font-size: 10px; padding: 2px 5px; border-radius: 3px; font-weight: 600; z-index: 1; }
.sm-list-info { flex: 1; min-width: 0; padding: 8px 12px; display: flex; flex-direction: column; }
.sm-list-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; min-height: 16px; }
.sm-list-tag { font-size: 10px; padding: 1px 5px; border-radius: 2px; background: #f0f4ff; color: #4F87FF; }
.sm-list-title { font-size: 13px; font-weight: 600; color: #1a1a1a; margin: 0 0 4px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 34px; }
.sm-list-desc { font-size: 11px; color: #888; margin: 0 0 6px; line-height: 1.4; flex: 1; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sm-list-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 5px; border-top: 1px solid #f0f0f0; min-height: 26px; }
.sm-list-price-wrap { flex-shrink: 0; min-width: 44px; }
.sm-list-price { font-size: 14px; font-weight: 700; color: #4F87FF; }
.sm-price-symbol { font-size: 10px; font-weight: 600; }
.sm-price-free { color: #4F87FF; }
.sm-list-meta { font-size: 10px; color: #aaa; display: flex; align-items: center; gap: 6px; }
.sm-list-views { white-space: nowrap; }
.sm-list-actions { display: inline-flex; min-width: 40px; }
.sm-list-demo { display: inline-flex; align-items: center; color: #fff; background: #4F87FF; font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 3px; transition: opacity 0.2s; white-space: nowrap; cursor: pointer; }
.sm-list-demo:hover { opacity: 0.85; }

/* ===== 无图列表模式 ===== */
.sm-list-nopic .sm-list-link { gap: 0; padding: 0; }
.sm-list-nopic .sm-list-info { padding: 14px 20px; }
.sm-list-nopic .sm-list-title { font-size: 15px; -webkit-line-clamp: 1; }
.sm-list-nopic .sm-list-bottom { border-top: none; padding-top: 0; margin-top: 8px; }
.sm-list-nopic .sm-list-desc { display: none; }
.sm-list-nopic .sm-list-tags { margin-bottom: 4px; }
.sm-list-nopic .sm-list-item { border-bottom: 1px solid #f0f0f0; border-radius: 0; box-shadow: none; }
.sm-list-nopic .sm-list-item:first-child { border-radius: 10px 10px 0 0; }
.sm-list-nopic .sm-list-item:last-child { border-bottom: none; border-radius: 0 0 10px 10px; }
.sm-list-nopic .sm-list-item:first-child:last-child { border-radius: 10px; }
.sm-list-nopic .sm-list-item:hover { transform: none; box-shadow: none; background: #f8f9fb; }

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .sm-layout { flex-direction: column; }
    .sm-sidebar { width: 100%; }
    .sm-cols-4,.sm-cols-5 { grid-template-columns: repeat(3,1fr); }
    .sm-hero-title { font-size: 26px; }
    .sm-hero-stats { grid-template-columns: repeat(2,1fr); min-width: auto; }
}
@media (max-width: 768px) {
    .sm-header-hero { padding: 18px 0; }
    .sm-hero-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .sm-hero-text { min-width: 100%; }
    .sm-hero-title { font-size: 22px; }
    .sm-hero-subtitle { font-size: 12px; }
    .sm-hero-banner-text { font-size: 11px; padding: 6px 14px; border-radius: 16px; letter-spacing: 1px; }
    .sm-hero-stats { width: 100%; gap: 8px 12px; padding: 10px 12px; }
    .sm-stat-text { font-size: 11px; }
    .sm-stat-icon { font-size: 14px; }
    .sm-cols-2,.sm-cols-3,.sm-cols-4,.sm-cols-5 { grid-template-columns: 1fr; }
    .sm-product-grid.sm-mobile-2col { grid-template-columns: repeat(2,1fr) !important; }
    .sm-card-demo { display: none; }
    .sm-filter-options { width: 100%; }
    .sm-filter-row-tags { flex-direction: column; align-items: flex-start; }
    .sm-filter-row-tags .sm-filter-label { font-size: 13px; color: #333; }
    .sm-filter-row-tags .sm-filter-options { width: 100%; gap: 8px; }
    .sm-search-group { min-width: auto; }
    .sm-sort-group { justify-content: flex-end; }
    .sm-filter-row { padding: 10px 14px; align-items: flex-start; flex-direction: column; }
    .sm-filter-label { width: auto; font-size: 12px; font-weight: 600; color: #666; margin-bottom: 6px; }
    .sm-filter-link { font-size: 12px; padding: 4px 8px; }
    .sm-sort-link { font-size: 12px; padding: 4px 10px; }
    .sm-hot-tabs { flex-direction: column; align-items: stretch; }
    .sm-search-input { width: 100%; }
    .sm-page-btn { min-width: 32px; height: 32px; font-size: 12px; }
    .sm-style-card .sm-product-card,
    .sm-style-list .sm-product-card { flex-direction: column; }
    .sm-style-card .sm-card-thumb, 
    .sm-style-list .sm-card-thumb { width: 100%; }
    .sm-style-list .sm-card-link { display: block; }
    .sm-list-pic .sm-list-link { flex-direction: row; }
    .sm-list-thumb { width: 100px; height: 80px; flex-shrink: 0; }
    .sm-list-info { padding: 6px 10px; }
    .sm-list-title { font-size: 12px; -webkit-line-clamp: 2; min-height: 30px; }
    .sm-list-desc { display: none; }
    .sm-list-price { font-size: 13px; }
    .sm-list-tags { margin-bottom: 2px; min-height: 14px; display: none; }
    .sm-list-demo { font-size: 10px; padding: 2px 6px; }
    .sm-list-bottom { padding-top: 4px; min-height: 22px; }
    .sm-service-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .sm-header-hero { padding: 16px 0; }
    .sm-hero-title { font-size: 19px; }
    .sm-hero-subtitle { font-size: 11px; }
    .sm-hero-banner-text { font-size: 10px; padding: 5px 10px; }
    .sm-hero-stats { gap: 6px; padding: 8px 10px; }
    .sm-stat-text { font-size: 10px; }
    .sm-stat-icon { font-size: 12px; }
}
