* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.header-container {
    z-index: 1000;
    background: white;
}

.transaction-records-public-container {
    margin: 0 5%;
    padding: 0 50px;
}

.page-header {
    text-align: center;
    margin: 30px 0;
}

.page-header h1 {
    font-size: 32px;
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.page-header .subtitle {
    font-size: 15px;
    color: #6c757d;
    margin: 0;
}

/* 篩選面板 */
.filter-panel {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 搜尋列 */
.search-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-btn {
    padding: 12px 28px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.search-btn:hover {
    background: #0056b3;
}

.clear-filters-btn {
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.clear-filters-btn:hover {
    background: #5a6268;
}

/* 篩選條件列 */
.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item label {
    font-size: 13px;
    color: #495057;
    font-weight: 600;
}

.filter-input,
.filter-select {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.date-range,
.range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-range span,
.range-inputs span {
    color: #6c757d;
    font-size: 13px;
}

.date-range .filter-input,
.range-inputs .filter-input {
    flex: 1;
    min-width: 0;
}


.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 18px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.results-info {
    font-size: 15px;
    color: #495057;
}

.results-info strong {
    color: #007bff;
    font-size: 18px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-toggle {
    display: flex;
    gap: 5px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 8px;
}

.view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.view-btn:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.view-btn.active {
    background: white;
    color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-options label {
    font-size: 14px;
    color: #6c757d;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sort-select:focus {
    outline: none;
    border-color: #007bff;
}

/* 記錄列表 - 卡片模式 */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.records-list.view-card {
    display: flex;
}

.records-list.view-table {
    display: none;
}

.record-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr auto;
    gap: 20px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.record-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    border-left: 4px solid #007bff;
}

.record-main-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.estate-name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    transition: color 0.2s;
}

.record-item:hover .estate-name {
    color: #007bff;
}

.transaction-date {
    color: #6c757d;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.transaction-date i {
    font-size: 12px;
}

.record-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #495057;
}

.detail-item i {
    color: #6c757d;
    width: 16px;
    font-size: 13px;
}

.detail-item .unit {
    color: #6c757d;
    font-size: 13px;
}

.record-price-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-main,
.price-sqft {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-label {
    font-size: 12px;
    color: #6c757d;
}

.price-main .price-value {
    color: #007bff;
    font-size: 20px;
    font-weight: 700;
}

.price-sqft .price-value {
    color: #28a745;
    font-size: 16px;
    font-weight: 700;
}

.record-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ced4da;
    font-size: 18px;
    transition: all 0.2s;
}

.record-item:hover .record-arrow {
    color: #007bff;
    transform: translateX(4px);
}

/* 記錄表格 - 列表模式 */
.records-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border-collapse: collapse;
}

.records-table.view-table {
    display: table;
}

.records-table.view-card {
    display: none;
}

.records-table thead {
    background: #f8f9fa;
}

.records-table th {
    padding: 15px 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.records-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.records-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.records-table td {
    padding: 16px 12px;
    font-size: 14px;
    color: #495057;
}

.table-estate-name {
    font-weight: 600;
    color: #2c3e50;
}

.table-floor {
    color: #495057;
}

.table-unit {
    color: #6c757d;
    font-size: 13px;
    margin-left: 4px;
}

.table-layout {
    color: #495057;
}

.table-area {
    color: #495057;
}

.table-price {
    color: #007bff;
    font-weight: 700;
    font-size: 15px;
}

.table-sqft-price {
    color: #28a745;
    font-weight: 700;
    font-size: 15px;
}

.table-date {
    color: #6c757d;
    font-size: 13px;
}

/* 無記錄提示 */
.no-records {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.no-records i {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.no-records p {
    font-size: 18px;
    color: #6c757d;
    margin: 0 0 25px 0;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #0056b3;
}

/* 分頁 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.page-link {
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.page-link:hover {
    background: #e9ecef;
}

.page-link.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .record-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .record-arrow {
        display: none;
    }
    
    .filters-row {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .records-table {
        display: none !important;
    }
    
    .records-list.view-table {
        display: flex !important;
    }
    
    .view-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .transaction-records-public-container {
        padding: 15px 10px;
        margin: 0;
    }

    .page-header h1 {
        font-size: 24px;
    }
    
    .page-header .subtitle {
        font-size: 14px;
    }

    .filter-panel {
        padding: 15px;
        border-radius: 8px;
    }

    .search-row {
        flex-direction: column;
        gap: 10px;
    }

    .search-btn,
    .clear-filters-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }

    .filters-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .filter-item {
        width: 100%;
    }
    
    .filter-item label {
        font-size: 12px;
    }
    
    .date-range,
    .range-inputs {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .date-range span,
    .range-inputs span {
        text-align: center;
        font-size: 12px;
    }
    
    .date-range .filter-input,
    .range-inputs .filter-input {
        width: 100%;
    }
    
    .filter-input,
    .filter-select {
        font-size: 14px;
        padding: 10px;
    }

    .records-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px;
    }
    
    .results-info {
        font-size: 14px;
    }
    
    .results-info strong {
        font-size: 16px;
    }
    
    .header-controls {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .sort-options {
        width: 100%;
    }
    
    .sort-options label {
        font-size: 13px;
    }

    .sort-select {
        flex: 1;
        font-size: 14px;
    }

    .record-item {
        padding: 15px;
        border-radius: 8px;
    }

    .estate-name {
        font-size: 16px;
    }
    
    .transaction-date {
        font-size: 12px;
    }
    
    .detail-item {
        font-size: 13px;
    }

    .price-main .price-value {
        font-size: 18px;
    }

    .price-sqft .price-value {
        font-size: 15px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 6px;
        padding: 15px;
    }

    .page-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .no-records {
        padding: 60px 15px;
    }
    
    .no-records i {
        font-size: 48px;
    }
    
    .no-records p {
        font-size: 16px;
    }
}

