/* ==================== CSS Variables ==================== */
:root {
    /* 主色调 - 专业的蓝绿色系 */
    --primary-color: #2c7a7b;
    --primary-dark: #234e52;
    --primary-light: #38b2ac;

    /* 辅助色 */
    --secondary-color: #ed8936;
    --accent-color: #3182ce;

    /* 中性色 */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --bg-gray: #f7fafc;
    --bg-white: #ffffff;

    /* 状态色 */
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --info: #4299e1;

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-gray);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==================== Header ==================== */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.header-top {
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: var(--spacing-sm) 0;
    gap: 1rem;
    transition: all 0.3s ease;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo a {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 28px;
    background: var(--bg-gray);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ==================== Header Stats Dashboard ==================== */
.header-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-gray);
    padding: 6px 16px;
    border-radius: 30px;
    margin-left: 32px;
    margin-right: auto;
    border: 1px solid var(--border-color);
    white-space: normal;
    text-align: center;
    transition: all 0.3s ease;
}

.header-stats b {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 14px;
}

.stat-divider {
    color: var(--border-color);
    opacity: 0.5;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.mobile-toggle:hover {
    background: var(--bg-gray);
    color: var(--primary-color);
}


.nav {
    display: flex;
    gap: var(--spacing-xl);
}

.nav-link {
    color: var(--text-secondary);
    font-size: 14px;
    padding: var(--spacing-sm) 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ==================== Stats Bar (Compact) ==================== */
.stats-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-sm) 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px 12px;
    background: var(--bg-gray);
    border-radius: var(--radius-md);
}

.stat-item-icon {
    font-size: 16px;
}

.stat-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-item-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.stat-item-label {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1;
}

/* ==================== Main Container ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* ==================== Page Header ==================== */
.page-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl) 0;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.page-header p {
    font-size: 16px;
    color: var(--text-muted);
}

/* ==================== Merchants Grid Page ==================== */
.merchants-grid-page {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

/* ==================== Products List Page ==================== */
.products-list-page {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

/* ==================== Search Trigger Button ==================== */
.search-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.search-trigger:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-gray);
}

/* ==================== Search Panel (Expandable) ==================== */
.search-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--bg-white);
    border-bottom: 1px solid transparent;
}

.search-panel.active {
    max-height: 120px;
    border-bottom-color: var(--border-color);
}

.search-panel-content {
    padding: var(--spacing-md) 0;
}

.search-tabs {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.search-tab {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.search-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-gray);
}

.search-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(44, 122, 123, 0.2);
}

.search-box {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 122, 123, 0.1);
}

.search-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--primary-dark);
}

.search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.search-close:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fffafa;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.15);
}

/* ==================== Unified Form Components ==================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.2s;
    background-color: var(--bg-white);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 122, 123, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white !important;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ==================== Modal System ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
}

.modal-content {
    background: var(--bg-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--bg-gray);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--danger);
}

/* ==================== Main Content Grid ==================== */
.main-content {
    margin-bottom: var(--spacing-xl);
}

.content-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}

/* ==================== Section Headers ==================== */
.section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.title-icon {
    font-size: 18px;
}

.view-more {
    font-size: 13px;
    color: var(--primary-color);
    cursor: pointer;
    transition: color 0.2s;
}

.view-more:hover {
    color: var(--primary-dark);
}

/* ==================== Merchants List (Left Column) ==================== */
.merchants-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    max-height: 850px;
    overflow-y: auto;
    padding-right: var(--spacing-xs);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Custom Scrollbar */
.merchants-list::-webkit-scrollbar {
    width: 6px;
}

.merchants-list::-webkit-scrollbar-track {
    background: transparent;
}

.merchants-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.merchants-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Premium Merchant Card */
.merchant-card {
    background: var(--bg-white);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.merchant-card:hover {
    transform: translateY(-4px) translateX(2px);
    box-shadow: 0 12px 24px rgba(44, 122, 123, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    border-color: rgba(44, 122, 123, 0.2);
}

.merchant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-md);
}

.merchant-info {
    flex: 1;
    min-width: 0;
}

.merchant-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merchant-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.merchant-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.merchant-tag-count {
    font-size: 11px;
    color: var(--primary-color);
    font-weight: 500;
    background: rgba(44, 122, 123, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
}

.reputation-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.reputation-badge.excellent {
    background: #e6fffa;
    color: #234e52;
}

.reputation-badge.good {
    background: #ebf8ff;
    color: #2c5282;
}

.reputation-badge.normal {
    background: #fffaf0;
    color: #7c2d12;
}

/* Optimized Business Content Area */
.merchant-business {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* Increased gap for better clarity */
    margin-bottom: var(--spacing-md);
    max-height: 180px;
    /* Increased height to show more content on PC */
    overflow: hidden;
    position: relative;
    padding-bottom: 15px;
    /* Space for the fade effect */
}

/* Fade out effect for overflowing text */
.business-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    /* Slightly taller fade for smoother transition */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 90%);
    pointer-events: none;
    z-index: 1;
}

.no-tags {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    width: 100%;
    padding: 8px 0;
}

.business-tag {
    padding: 3px 10px;
    /* More compact padding */
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
    /* Slightly larger for readability on PC */
    color: var(--text-secondary);
    transition: all 0.2s;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
}

.merchant-card:hover .business-tag {
    background: #ffffff;
    border-color: var(--primary-light);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.merchant-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: var(--spacing-md);
    border-top: 1px solid #f1f5f9;
}

.merchant-status-text {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.contact-btn {
    padding: 8px 18px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(44, 122, 123, 0.2);
}

.contact-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(44, 122, 123, 0.3);
}

.contact-btn:active {
    transform: translateY(0);
}

/* ==================== Products Section (Right Column) ==================== */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==================== New Product Filter Bar ==================== */
.product-filters-container {
    background: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-select,
.filter-input {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    background: var(--bg-white);
    color: var(--text-primary);
    min-width: 120px;
}

.filter-input {
    min-width: 150px;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 122, 123, 0.1);
}

@media (max-width: 768px) {
    .product-filters-container {
        gap: var(--spacing-md);
        padding: var(--spacing-sm);
    }

    .filter-group {
        width: 100%;
        justify-content: space-between;
    }

    .filter-select,
    .filter-input {
        flex: 1;
        max-width: 200px;
    }

    .quick-filters {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ==================== Products List - Table Style ==================== */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 800px;
    overflow-y: auto;
}

.products-list::-webkit-scrollbar {
    width: 6px;
}

.products-list::-webkit-scrollbar-track {
    background: var(--bg-gray);
    border-radius: 3px;
}

.products-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.products-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.products-header {
    display: grid;
    grid-template-columns: 1fr 200px 120px 100px;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-color);
}

.header-cell {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.header-cell.text-center {
    text-align: center;
}

.header-cell.text-right {
    text-align: right;
}

.product-item {
    display: grid;
    grid-template-columns: 1fr 200px 120px 100px;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
}

.product-item:hover {
    background: var(--bg-gray);
}

.product-item:last-child {
    border-bottom: none;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 2px;
    /* 优化：超过两行自动显示省略号，防止撑开行高 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    word-break: break-all;
}

.product-merchant {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.merchant-reputation {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--warning);
}

.product-name a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.product-name a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.product-price-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.product-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--danger);
}

.product-price-unit {
    font-size: 11px;
    color: var(--text-muted);
}

.product-stock-cell {
    text-align: center;
}

.product-stock {
    display: inline-block;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.product-stock.high {
    background: #c6f6d5;
    color: #22543d;
}

.product-stock.medium {
    background: #feebc8;
    color: #7c2d12;
}

.product-stock.low {
    background: #fed7d7;
    color: #742a2a;
}

.product-time {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) 0;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
}

.empty-hint {
    font-size: 12px;
    margin-top: var(--spacing-sm);
}

/* ==================== Footer ==================== */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    margin-top: var(--spacing-xl);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.footer-logo {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
}

.footer-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-nav a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.2s;
    white-space: nowrap;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding: 1.25rem 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==================== Responsive ==================== */
@media (max-width: 1200px) {
    .header-stats {
        font-size: 11px;
        padding: 4px 12px;
        margin-left: 1rem;
    }
}

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .merchants-list,
    .products-list {
        max-height: none;
    }

    .product-item {
        grid-template-columns: 1fr 150px 100px 80px;
        gap: var(--spacing-sm);
    }

    .merchants-grid-page {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Header Mobile */
    .header-top {
        flex-wrap: wrap;
        padding: 0.75rem 0;
    }

    .logo {
        flex: 1;
        min-width: 0;
    }

    .header-stats {
        order: 3;
        width: 100%;
        margin: 10px 0 0 0;
        justify-content: center;
        white-space: normal;
        height: auto;
        padding: 8px;
    }

    .header-actions {
        order: 2;
        flex-shrink: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .nav {
        order: 4;
        display: none !important;
        flex-direction: column;
        width: 100%;
        gap: 0;
        border-top: 1px solid var(--border-color);
        padding-top: var(--spacing-sm);
    }

    .nav.mobile-active {
        display: flex !important;
    }

    .nav-link {
        padding: var(--spacing-md);
        text-align: center;
        border-bottom: 1px solid var(--bg-gray);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    /* Products Header - hide on mobile */
    .products-header {
        display: none;
    }

    /* Content Grid */
    .content-grid {
        grid-template-columns: 1fr;
    }

    /* Product Item - compact on mobile */
    .product-item {
        grid-template-columns: 1fr auto;
        gap: var(--spacing-xs) var(--spacing-sm);
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .product-info {
        grid-column: 1 / -1;
    }

    .product-price-cell {
        align-items: flex-start;
    }

    .product-stock-cell {
        text-align: right;
    }

    .product-time {
        grid-column: 1 / -1;
        text-align: left;
    }

    /* Search Panel */
    .search-panel.active {
        max-height: 160px;
    }

    /* Filter Tabs */
    .filter-tabs,
    .filter-tabs-row {
        flex-wrap: wrap;
    }

    /* Footer Mobile */
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 1.25rem;
        padding: 1.5rem 0;
    }

    .footer-brand {
        align-items: center;
    }

    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem 1.5rem;
    }

    /* Page Header */
    .page-header {
        padding: var(--spacing-md) 0;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header p {
        font-size: 14px;
    }

    /* Merchants Grid */
    .merchants-grid-page {
        grid-template-columns: 1fr;
    }

    /* Merchant Card - no translate on mobile */
    .merchant-card:hover {
        transform: none;
    }

    /* Contact button - larger tap target on mobile */
    .contact-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Container padding */
    .container {
        padding: var(--spacing-md);
    }

    /* Dashboard responsive */
    .dashboard-layout {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        z-index: 200;
        border-radius: 0 !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding-top: 80px !important;
        box-shadow: none !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15) !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 199;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-toggle {
        display: inline-flex !important;
    }

    .dashboard-content {
        padding: 1rem !important;
        min-height: auto !important;
    }

    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .welcome-section h2 {
        font-size: 1.2rem !important;
    }

    /* Dashboard table responsive */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .action-btns {
        flex-direction: column;
        gap: 0.25rem;
    }

    /* Dashboard header mobile */
    .dashboard-header-right {
        gap: 0.75rem !important;
    }

    /* Merchant Card Mobile Adjustments */
    .merchant-card {
        padding: var(--spacing-md);
    }

    .merchant-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .reputation-badge {
        align-self: flex-start;
    }

    .merchant-footer {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
        text-align: center;
    }

    .contact-btn {
        width: 100%;
        padding: 10px;
    }

    .merchant-business {
        max-height: 100px;
        /* More compact on mobile */
    }
}

/* ==================== Utilities ==================== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Toast 通知 ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--info);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
    min-width: 280px;
    font-size: 14px;
    color: var(--text-primary);
}

.toast-item.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-item.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.5;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* ==================== 自定义 Modal 弹窗 ==================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal-overlay.active {
    visibility: visible;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.custom-modal {
    background: var(--bg-white);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.custom-modal-overlay.active .custom-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.custom-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px 0;
}

.custom-modal-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.custom-modal-title {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.custom-modal-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.custom-modal-close:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
}

.custom-modal-body {
    padding: 16px 24px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-line;
    word-break: break-word;
}

.custom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 20px;
}

.custom-modal-btn {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-width: 80px;
}

.custom-modal-btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.custom-modal-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 122, 123, 0.3);
}

.custom-modal-btn-danger {
    background: var(--danger);
    color: #fff;
}

.custom-modal-btn-danger:hover {
    background: #e53e3e;
    transform: translateY(-1px);
}

.custom-modal-btn-default {
    background: var(--bg-gray);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.custom-modal-btn-default:hover {
    background: #edf2f7;
    color: var(--text-primary);
}

/* 联系方式专用样式 */
.contact-info-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 10px 14px;
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    user-select: all;
}

.contact-info-link {
    font-size: 15px;
    color: var(--primary-color);
    text-decoration: none;
    padding: 10px 14px;
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    display: block;
    word-break: break-all;
}

.contact-info-link:hover {
    color: var(--primary-dark);
    background: #e6fffa;
    border-color: var(--primary-light);
}

/* Modal 类型颜色提示 */
.custom-modal-success .custom-modal-header {
    border-bottom: 3px solid var(--success);
    padding-bottom: 16px;
}

.custom-modal-error .custom-modal-header {
    border-bottom: 3px solid var(--danger);
    padding-bottom: 16px;
}

.custom-modal-warning .custom-modal-header {
    border-bottom: 3px solid var(--warning);
    padding-bottom: 16px;
}

.custom-modal-info .custom-modal-header {
    border-bottom: 3px solid var(--info);
    padding-bottom: 16px;
}

.custom-modal-contact .custom-modal-header {
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 16px;
}

.custom-modal-question .custom-modal-header {
    border-bottom: 3px solid var(--warning);
    padding-bottom: 16px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast-item {
        max-width: none;
        min-width: 0;
    }

    .custom-modal {
        width: 95%;
        max-width: none;
        margin: 0 10px;
    }

    .custom-modal-footer {
        flex-direction: column;
    }

    .custom-modal-btn {
        width: 100%;
    }
}

/* ==================== Unified Merchant Detail Styles ==================== */
.merchant-detail {
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin-bottom: var(--spacing-xl);
}

.merchant-detail-header-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.merchant-detail-main {
    display: flex;
    gap: var(--spacing-xl);
    align-items: flex-start;
}

.merchant-detail-content {
    flex: 1;
    min-width: 0;
}

.merchant-detail-name-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.merchant-detail-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.merchant-detail-meta {
    display: flex;
    gap: 16px;
    margin-bottom: var(--spacing-lg);
    font-size: 13px;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.merchant-detail-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.contact-btn-large {
    padding: 12px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 20px rgba(44, 122, 123, 0.25);
}

.contact-btn-large:hover {
    background: var(--primary-dark);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 30px rgba(44, 122, 123, 0.35);
}

.website-link-btn {
    padding: 12px 24px;
    background: var(--bg-gray);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.website-link-btn:hover {
    background: var(--bg-white);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.merchant-detail-image-container {
    width: 240px;
    flex-shrink: 0;
}

.merchant-detail-image {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: var(--shadow-md);
    border: 4px solid var(--bg-gray);
}

/* Response for Merchant Detail */
@media (max-width: 992px) {
    .merchant-detail-main {
        flex-direction: column-reverse;
    }

    .merchant-detail-image-container {
        width: 100%;
    }

    .merchant-detail-image {
        height: 200px;
    }

    .merchant-detail-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .merchant-detail-actions {
        flex-direction: column;
    }

    .contact-btn-large,
    .website-link-btn {
        width: 100%;
    }
}