* {
    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;
}

/* 手機版頁眉樣式 - 保持 sticky */
@media (max-width: 767px) {
    .header-container {
        position: sticky;
        top: 0;
    }
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.slider-container {
    position: relative;
    /* width: 90%; */
    margin: 0 0 30px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    height: 400px; /* 电脑端轮播图高度调小 */
}

.slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

/* 移动端拖拽样式 */
@media (max-width: 767px) {
    .slider-container {
        touch-action: pan-y;
    }

    .slider {
        cursor: grab;
    }

    .slider.grabbing {
        cursor: grabbing;
        transition: none;
    }
}

.slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 30px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    user-select: none;
}

.slide-content {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 600px;
}

.slide-title {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: bold;
}

.slide-location {
    font-size: 14px;
}

.slide-desc {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.slide-desc > span {
    display: inline-flex;
    align-items: center;
}

.slide-desc .property-price {
    letter-spacing: 0.5px;
}

.slider-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: white;
    transform: scale(1.3);
}

/* 左右导航按钮样式 */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: none; /* 默认隐藏，只在桌面端显示 */
}

.slider-nav:hover {
    background: rgba(0, 0, 0, 0);
    transform: translateY(-50%) scale(1.1);
}

.slider-nav-prev {
    left: 20px;
}

.slider-nav-next {
    right: 20px;
}

.tabs {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 0 0 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.tab-headers {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 25px;
}

.tab-header {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-header.active {
    color: black;
    border-bottom: 3px solid black;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.tab-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.tab-item {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f0f0f0;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-item:hover {
    background: #f0f0f0;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #86ebff;
}

.tab-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.tab-row {
    margin-bottom: 15px;
}

.simple-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 0 0 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 20px;
    color: black;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    font-weight: bold;
}

.simple-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.simple-item {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f0f0f0;
    font-weight: 500;
}

.simple-item:hover {
    background: #f0f0f0;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #86ebff;
}

.simple-row {
    margin-bottom: 15px;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #999;
    padding-bottom: 30px;
}

/* 服務項目文字換行控制 - 桌面端隱藏換行 */
@media (min-width: 769px) {
    .mobile-break {
        display: none;
    }
}

/* 移動端顯示換行 */
@media (max-width: 768px) {
    .mobile-break {
        display: inline;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section {
    animation: fadeIn 0.5s ease forwards;
}

/* 設定頁面樣式 */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.settings-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.settings-header {
    background: linear-gradient(135deg, #86ebff, #6a0dad);
    color: white;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.settings-body {
    padding: 25px;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-option:hover {
    border-color: #86ebff;
}

.language-option.selected {
    border-color: #86ebff;
}

.language-flag {
    width: 30px;
    height: 35px;
    margin-right: 20px;
    font-size: 22px;
}

.language-name {
    font-weight: bold;
    flex: 1;
    font-size: 16px;
}

.language-check {
    color: #86ebff;
    font-weight: bold;
    font-size: 18px;
}

.settings-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.settings-btn-primary {
    flex: 1;
    background: #86ebff;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.settings-btn-secondary {
    flex: 1;
    background: #f0f0f0;
    color: #666;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.settings-btn-primary:hover {
    background: #7a1bd2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

.settings-btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* 大屏幕优化 */
@media (min-width: 1200px) {
    .slider-container {
        height: 450px; /* 大屏幕轮播图高度调小 */
        max-width: 1200px;
        margin: 0 auto 40px;
    }
    .slide-content {
        max-width: 800px;
    }
    .slide-title {
        font-size: 24px;
    }
}

/* 主頁房產卡片樣式調整 */
.simple-section .property-grid {
    margin-top: 15px;
}

.simple-section .property-card {
    margin: 0;
}

/* 從 property.css 複製的樣式 - Property Card 相關 */
.property-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-height: fit-content;
}

.property-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    margin: 10px;
    position: relative;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.property-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.property-content {
    padding: 0px 10px 10px 10px;
}

.property-title-card {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    max-height: 2.8em; /* 1.4 * 2 行 */
}

.property-info {
    justify-content: center;
    font-size: 12px;
    color: #666;
    display: flex;
    flex-direction: column;
}

.property-info .property-area {
    display: block;
}

.property-info .property-location {
    display: block;
}

.property-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.feature-tag {
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 12px;
    color: #495057;
}

.no-properties {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-properties-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* 從 property.css 複製的樣式 - Sidebar Widget 相關 */
.property-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
}

.property-item:last-child {
    border-bottom: none;
}

.property-image-small {
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 8px;
    flex-shrink: 0;
}

.property-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.widget-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.widget-property-price {
    font-size: 14px;
    color: red;
    font-weight: 600;
    margin-bottom: 2px;
}

.widget-location {
    font-size: 12px;
    color: #666;
}

.sidebar-location {
    font-size: 12px;
    color: #666;
}

.no-data-message {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

/* 手机版样式保持不变 */
@media (max-width: 767px) {
    .main-content {
        padding-top: 25px;
    }
    
    .slider-container {
        height: 200px;
        margin: 0 5% 30px;
        width: 90%;
    }
    .slide {
        padding: 15px;
    }
    .slide-content {
        padding: 15px;
    }
    .slide-title {
        font-size: 18px;
    }
    .slide-desc {
        display: none;
        font-size: 13px;
        gap: 8px;
        margin-top: 8px;
        padding: 8px 0;
    }
    .slide-desc > span {
        padding: 4px 10px;
        font-size: 12px;
    }
    .slide-desc .property-price {
        font-size: 14px;
    }
    .tabs, .simple-section {
        padding: 15px;
        margin: 0 5% 25px;
    }
    .tab-grid, .simple-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    .tab-item, .simple-item {
        padding: 12px 3px;
        font-size: 14px;
    }

    .sidebar {
        display: none;
    }

    /* 手機版房產卡片調整 - 一行8個，橫向滑動 */
    .simple-section .property-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 15px;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch; /* iOS 流暢滾動 */
        scrollbar-width: none; /* Firefox 隱藏滾動條 */
        -ms-overflow-style: none; /* IE/Edge 隱藏滾動條 */
    }

    .simple-section .property-grid::-webkit-scrollbar {
        display: none; /* Chrome/Safari 隱藏滾動條 */
    }

    .simple-section .property-card {
        flex: 0 0 200px; /* 固定寬度200px */
        min-width: 200px;
    }
}

@media (min-width: 768px) {
    .header-container {
        position: relative;
    }
    
    .slider-nav {
        display: block;
    }
    
    #buy-tab .tab-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 12px;
    }
    
    #buy-tab .tab-item {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    #buy-tab .tab-icon {
        font-size: 22px;
        margin-bottom: 4px;
    }
    
    #rent-tab .tab-grid,
    #owner-tab .tab-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 12px;
    }
    
    #rent-tab .tab-item,
    #owner-tab .tab-item {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    #rent-tab .tab-icon,
    #owner-tab .tab-icon {
        font-size: 22px;
        margin-bottom: 4px;
    }
    
    .slider-container {
        height: 400px;
    }
    
    .main-container {
        display: flex;
        gap: 30px;
        margin-top: 20px;
        margin: 20px 5% 0 5%;
        padding: 0 50px;
    }
    
    .main-content {
        flex: 1;
        max-width: calc(100% - 350px);
    }
    
    .sidebar {
        width: 320px;
        flex-shrink: 0;
    }
    
    .simple-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 12px;
    }
    
    .simple-item {
        padding: 15px 8px;
        font-size: 13px;
    }
    
    .sidebar-widget {
        background: white;
        border-radius: 15px;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    
    .widget-title {
        font-size: 18px;
        color: #333;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid #f0f0f0;
        font-weight: bold;
    }
    
    .property-item {
        display: flex;
        gap: 12px;
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .property-item:last-child {
        border-bottom: none;
    }
    
    .property-image img {
        width: 60px;
        height: 60px;
        border-radius: 8px;
        object-fit: cover;
    }
    
    .property-price-side {
        font-size: 13px;
        color: red;
        font-weight: 600;
        margin-bottom: 2px;
    }
    
    .search-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .search-tag {
        background: #f8f9fa;
        color: #666;
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 12px;
        border: 1px solid #e9ecef;
        transition: all 0.3s ease;
        cursor: pointer;
    }
    
    .search-tag:hover {
        background: #86ebff;
        color: white;
        border-color: #86ebff;
    }
    
    .market-trend {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .trend-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .trend-item:last-child {
        border-bottom: none;
    }
    
    .trend-label {
        font-size: 14px;
        color: #333;
    }
    
    .trend-value {
        font-size: 14px;
        font-weight: 600;
        color: #86ebff;
    }
    
    .contact-info {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .contact-item {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .contact-icon {
        font-size: 16px;
        width: 20px;
        text-align: center;
    }
    
    .contact-text {
        font-size: 14px;
        color: #333;
    }

    /* 成交記錄側邊欄 */
    .transaction-record-item {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
        transition: background 0.2s;
    }

    .transaction-record-item:last-of-type {
        border-bottom: none;
    }

    .transaction-record-item:hover {
        background: #f8f9fa;
        margin: 0 -12px;
        padding: 10px 12px;
        border-radius: 6px;
    }

    .transaction-record-estate {
        font-size: 14px;
        font-weight: 600;
        color: #222;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .transaction-record-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .transaction-record-price {
        font-size: 13px;
        color: #e74c3c;
        font-weight: 600;
    }

    .transaction-record-date {
        font-size: 12px;
        color: #999;
    }

    .view-more-link {
        display: inline-block;
        font-size: 13px;
        text-decoration: none;
        padding: 4px 0;
    }

    .view-more-link:hover {
        text-decoration: underline;
    }
}
