/**
 * 企业黄页列表页 - 样式文件
 * 设计风格：复用 classified-list.css 布局，适配商家卡片
 */

/* ========================================
   迷你 Header（复用 classified-list.css）
   ======================================== */
.mini-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    max-width: 680px;
    margin: 0 auto;
}

.mini-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mini-back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.mini-back-btn:active {
    transform: scale(0.95);
}

.mini-back-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.mini-category {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mini-category-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
}

.mini-actions {
    display: flex;
    gap: 8px;
}

.mini-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mini-action-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.mini-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* ========================================
   搜索区域（默认隐藏，点击展开）
   ======================================== */
.search-section {
    display: none;
    overflow: hidden;
    animation: searchSlideDown 0.3s ease forwards;
}

.search-section.show {
    display: block;
}

@keyframes searchSlideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 100px;
        padding-top: 12px;
        padding-bottom: 16px;
    }
}

/* ========================================
   子分类导航
   ======================================== */
.sub-nav {
    position: relative;
    z-index: 90;
    background: linear-gradient(180deg, rgba(255, 251, 247, 0.98) 0%, rgba(255, 251, 247, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 85, 46, 0.08);
    padding: 10px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.sub-nav-wrapper {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    max-width: 680px;
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sub-nav-wrapper::-webkit-scrollbar {
    display: none;
}

.sub-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    white-space: nowrap;
}

.sub-nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sub-nav-item:hover {
    border-color: rgba(255, 85, 46, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 85, 46, 0.1);
}

.sub-nav-item.active {
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(255, 85, 46, 0.25);
}

.sub-nav-item.active::before {
    opacity: 1;
}

.sub-nav-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.sub-nav-item.active .sub-nav-text {
    color: white;
}

/* ========================================
   筛选排序区
   ======================================== */
.filter-section {
    position: relative;
    z-index: 80;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid var(--border);
    gap: 12px;
    max-width: 680px;
    margin: 0 auto;
}

.filter-tabs {
    display: flex;
    flex: 1;
    gap: 4px;
}

.filter-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-tab svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.7;
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(255, 85, 46, 0.25);
}

.filter-tab.active svg {
    opacity: 1;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

.filter-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-action-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.filter-action-btn .arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.25s ease;
}

.filter-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-action-btn.active .arrow {
    transform: rotate(180deg);
}

/* 排序面板 */
.sort-panel {
    position: absolute;
    top: 100%;
    right: 16px;
    width: 180px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 100;
}

.sort-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-option:hover {
    background: rgba(255, 85, 46, 0.05);
    color: var(--primary);
}

.sort-option.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.sort-option svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sort-option.active svg {
    opacity: 1;
}

/* 遮罩层 */
.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 70;
}

.filter-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   主内容区
   ======================================== */
.main {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px;
    padding-bottom: 100px;
}

.business-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
}

/* ========================================
   商家卡片
   ======================================== */
.business-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: cardSlideIn 0.35s ease backwards;
}

.business-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(255, 85, 46, 0.2);
}

/* business-header 样式在 Logo 与热门标签区块中定义 */

.business-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
}

.business-category {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 85, 46, 0.08);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid rgba(255, 85, 46, 0.15);
    align-self: flex-start;
}

.business-address {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.business-address svg {
    width: 16px;
    height: 16px;
    fill: var(--text-muted);
    flex-shrink: 0;
    margin-top: 2px;
}

.business-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.business-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    margin-top: 4px;
}

.business-views {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.business-views svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.business-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   空状态
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    fill: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ========================================
   动画
   ======================================== */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.business-card:nth-child(1) { animation-delay: 0.03s; }
.business-card:nth-child(2) { animation-delay: 0.06s; }
.business-card:nth-child(3) { animation-delay: 0.09s; }
.business-card:nth-child(4) { animation-delay: 0.12s; }
.business-card:nth-child(5) { animation-delay: 0.15s; }
.business-card:nth-child(6) { animation-delay: 0.18s; }
.business-card:nth-child(7) { animation-delay: 0.21s; }
.business-card:nth-child(8) { animation-delay: 0.24s; }

/* ========================================
   商家 Logo 与热门标签
   ======================================== */
.business-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.business-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.business-logo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(255, 85, 46, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.business-logo-placeholder svg {
    width: 24px;
    height: 24px;
    fill: var(--text-muted);
}

.business-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.business-hot-tag {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #FF552E 0%, #F5A623 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

/* ========================================
   加载更多与加载状态
   ======================================== */
.load-more {
    display: flex;
    justify-content: center;
    padding: 20px 0 10px;
}

.load-more-btn {
    padding: 10px 32px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    background: rgba(255, 85, 46, 0.06);
    border: 1px solid rgba(255, 85, 46, 0.2);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.load-more-btn:hover {
    background: rgba(255, 85, 46, 0.12);
    border-color: var(--primary);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 0.85rem;
}

/* ========================================
   响应式
   ======================================== */
@media (min-width: 768px) {
    .business-card {
        padding: 18px;
    }

    .business-name {
        font-size: 1.1rem;
    }

    .sort-panel {
        right: 50%;
        transform: translateX(50%) translateY(-10px);
    }

    .sort-panel.show {
        transform: translateX(50%) translateY(0);
    }
}

@media (max-width: 374px) {
    .sub-nav-item {
        padding: 6px 10px;
    }

    .sub-nav-text {
        font-size: 0.75rem;
    }

    .business-card {
        padding: 14px;
    }

    .business-name {
        font-size: 0.95rem;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .sub-nav {
        background: linear-gradient(180deg, rgba(26, 26, 26, 0.98) 0%, rgba(26, 26, 26, 0.95) 100%);
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    .sub-nav-item {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .sub-nav-item:hover {
        border-color: rgba(255, 85, 46, 0.3);
    }

    .filter-bar {
        background: rgba(26, 26, 26, 0.6);
    }

    .filter-tab,
    .filter-action-btn {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .business-card {
        background: var(--bg-card);
        border-color: rgba(255, 255, 255, 0.06);
    }

    .business-footer {
        border-top-color: rgba(255, 255, 255, 0.06);
    }

    .filter-overlay {
        background: rgba(0, 0, 0, 0.6);
    }
}