:root {
    --primary: #4a90e2;
    --primary-dark: #3a7bc8;
    --light-bg: #f8f9fa;
    --border: #e3e7ee;
    --text: #333;
    --text-light: #666;
    --radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.spa-main {
    max-width: 1200px;
    margin: 8rem auto 2rem;
    padding: 0 16px 32px;
}

/* 頁首 */
.spa-header {
    margin-bottom: 32px;
    text-align: center;
}

.spa-header-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.spa-header-sub {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* 主要布局 */
.spa-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

@media (max-width: 992px) {
    .spa-layout {
        grid-template-columns: 1fr;
    }
}

/* 篩選區域 */
.spa-filter-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 100px;
}

.spa-filter-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #2c3e50;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.spa-filter-group {
    margin-bottom: 16px;
}

.spa-filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.spa-filter-group select,
.spa-filter-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.spa-filter-group select:focus,
.spa-filter-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.price-range-container {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.price-range-container input {
    flex: 1;
}

.spa-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.spa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    flex: 1;
}

.spa-btn-primary {
    background: var(--primary);
    color: white;
}

.spa-btn-primary:hover {
    background: var(--primary-dark);
}

.spa-btn-secondary {
    background: var(--light-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.spa-btn-secondary:hover {
    background: #e9ecef;
}

/* 工具欄 */
.spa-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.spa-toolbar-count {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.spa-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.spa-sort select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 150px;
}

.spa-sort select:focus {
    outline: none;
    border-color: var(--primary);
}

/* 卡片網格 */
.spa-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
}

.spa-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.spa-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.spa-card-img-wrap {
    display: inline-block;
    position: relative;
    width: 100%;
    padding-bottom: 65%;
    overflow: hidden;
}

.spa-card-img-wrap img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    left: 0;
    top: 0;
}

.spa-card-body {
    padding: 16px;
}

.spa-card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.spa-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
}

.spa-card-title a {
    color: inherit;
    text-decoration: none;
}

.spa-card-title a:hover {
    color: var(--primary);
}

.spa-card-area {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.spa-card-rating {
    font-size: 14px;
    color: #f39c12;
    font-weight: 500;
}

.spa-card-rating span {
    color: #999;
    font-weight: normal;
}

.spa-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 12px 0;
}

.spa-tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--light-bg);
    color: var(--text);
}

.spa-card-price {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 8px;
}

.spa-card-price span {
    font-weight: normal;
    font-size: 13px;
    color: var(--text-light);
    margin-left: 4px;
}

.spa-card-footer {
    padding: 0 16px 16px;
}

.spa-card-footer .spa-btn {
    width: 100%;
    padding: 10px;
}

/* 空狀態 */
.spa-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-light);
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* 分頁 */
.spa-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.spa-pagination a,
.spa-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.spa-pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.spa-pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 響應式 */
@media (max-width: 768px) {
    .spa-main {
        padding: 0 12px 24px;
    }

    .spa-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .spa-sort {
        width: 100%;
    }

    .spa-card-grid {
        grid-template-columns: 1fr;
    }

    .spa-header-title {
        font-size: 22px;
    }

    .spa-header-sub {
        font-size: 14px;
    }
}