body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.property-detail-container {
    margin: 0 auto;
    padding-bottom: 80px;
}

.property-detail-header {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.property-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 0px;
}

.property-price {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
}

/* 樓盤標題和價格重點顯示區域 */
.property-title-price-section {
    padding: 0px 10px 0px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.property-title-price-section .title-price-content {
    flex: 1;
}

.property-title-price-section .property-title {
    font-weight: bold;
    margin-top: 0;
}

.property-title-price-section .property-price {
    color: red;
    font-weight: bold;
    margin-bottom: 0;
}

/* 桌面端操作按鈕 */
.desktop-action-buttons {
    display: none; /* 默認隱藏（手機端） */
    gap: 10px;
    align-items: flex-start;
}

.desktop-action-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.desktop-action-btn svg {
    width: 24px;
    height: 24px;
    color: #666;
    transition: color 0.3s ease;
}

.desktop-action-btn:hover {
    border-color: #86ebff;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(134, 235, 255, 0.3);
}

.desktop-action-btn:hover svg {
    color: #86ebff;
}

.desktop-action-btn.favorite-btn.active {
    border-color: #ff4757;
    background: #fff5f5;
}

.desktop-action-btn.favorite-btn.active svg {
    color: #ff4757;
    fill: #ff4757;
}

/* 桌面端顯示操作按鈕 */
@media (min-width: 769px) {
    .desktop-action-buttons {
        display: flex;
    }
}

.property-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.meta-icon {
    font-size: 20px;
    color: #86ebff;
}

.meta-icon-img {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
}

.meta-label {
    font-weight: bold;
    color: #666;
    font-size: 14px;
}

.meta-value {
    font-weight: bold;
    color: #333;
}

.property-gallery {
    margin-bottom: 25px;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
}

.image-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.thumbnail {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.thumbnail:hover {
    transform: scale(1.05);
}

.property-description {
    background: white;
    border-radius: 12px;
    padding: 15px 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.description-text {
    line-height: 1.8;
    color: #666;
}

.property-features {
    background: white;
    border-radius: 12px;
    padding: 15px 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.feature-tag {
    padding: 8px 12px;
    border: 1px solid black;
    border-radius: 20px;
    font-size: 12px;
    color: black;
    text-align: center;
}

.property-location {
    background: white;
    border-radius: 12px;
    padding: 15px 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.location-map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.location-info {
    color: #666;
    line-height: 1.6;
}

.property-company-info {
    background: white;
    border-radius: 12px;
    padding: 15px 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.company-details {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.company-logo {
    flex-shrink: 0;
}

.company-logo-img {
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.company-info {
    flex: 1;
}

.company-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.company-address,
.company-license {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.property-contact {
    background: white;
    border-radius: 12px;
    padding: 15px 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.agent-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.agent-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.agent-details {
    flex: 1;
}

.agent-name {
    font-weight: bold;
    font-size: 18px;
    color: #333;
    margin-bottom: 5px;
}

.agent-license {
    color: #666;
    font-size: 13px;
    margin-bottom: 3px;
}

.agent-company {
    color: #666;
    font-size: 14px;
}

.contact-buttons {
    display: flex;
    gap: 15px;
}

.contact-button {
    flex: 1;
    padding: 15px;
    border: 1px solid black;
    border-radius: 8px;
    background: white;
    color: black;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.contact-button.primary {
    background: #25d366;
    color: white;
}

.contact-button .whatsapp-icon {
    width: 1em;
    height: 1em;
    margin-right: 6px;
    vertical-align: -0.125em;
    display: inline-block;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.contact-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.2);
}

.contact-button.primary:hover {
    background: #7a1bd2;
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px;
    background: transparent;
    border: none;
    border-radius: 50%;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    position: fixed;
    top: 85px;
    left: 15px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.back-button:hover {
    background: #86ebff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

/* 詳細參數樣式 */
.property-parameters {
    margin-bottom: 20px;
}

.parameters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.parameter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #86ebff;
}

.parameter-label {
    font-weight: bold;
    color: #666;
    font-size: 14px;
}

.parameter-value {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* 4格信息框樣式 */
.info-grid-container {
    margin-bottom: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.info-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0px;
}

.info-grid-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    /* border-left: 4px solid #86ebff; */
}

.info-grid-line {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.info-grid-line:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: bold;
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.info-value {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.info-value.price {
    /* color: #86ebff; */
    font-size: 16px;
    font-weight: bold;
}

/* 客廳圖片輪播樣式 */
.living-room-carousel {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    justify-content: center;
}

.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
    display: none;
}

.carousel-slide.active {
    display: block;
}

.carousel-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

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

.carousel-dot.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

.no-images-message {
    text-align: center;
    padding: 80px;
    color: #999;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 融合的圖片輪播和樓盤信息框樣式 */
.property-hero-section {
    position: relative;
    background: white;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.hero-carousel {
    position: relative;
    height: 320px;
    overflow: hidden;
}

.hero-carousel .carousel-container {
    height: 100%;
    border-radius: 0;
}

.hero-carousel .carousel-image {
    height: 320px;
    width: 100%;
    object-fit: cover;
}

.hero-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: white;
    padding: 30px 25px 10px;
    z-index: 5;
}

.hero-info-overlay .property-title {
    font-size: 25px;
    font-weight: bold;
    margin-bottom: 0;
}

.hero-info-overlay .property-price {
    font-size: 25px;
    font-weight: bold;
    color: black;
    margin-bottom: 0;
}

/* 樓盤介紹表格樣式 */
.property-introduction {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.introduction-table {
    margin-top: 15px;
}

.introduction-table table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.introduction-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.introduction-table tr:last-child {
    border-bottom: none;
}

.introduction-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.introduction-table tr:hover {
    background-color: #f0f0f0;
}

.table-label {
    padding: 12px 15px;
    font-weight: bold;
    color: #666;
    font-size: 14px;
    background-color: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    width: 30%;
    text-align: right;
}

.table-value {
    padding: 12px 15px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
    width: 70%;
    text-align: left;
}

@media (max-width: 768px) {
    .introduction-table table {
        font-size: 12px;
    }

    .table-label,
    .table-value {
        padding: 8px 10px;
    }

    .property-introduction {
        padding: 15px;
    }
    .property-detail-container {
        padding: 15px;
        padding-bottom: 80px;
    }

    .property-title {
        font-size: 24px;
    }

    .property-price {
        font-size: 28px;
    }

    .main-image {
        height: 250px;
    }

    .location-map {
        height: 200px;
    }

    .contact-buttons {
        flex-direction: column;
    }

    .property-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 10px;
    }

    .property-meta .meta-item:only-child {
        grid-column: 1 / -1;
    }

    /* 地產代理公司資料響應式樣式 */
    .property-company-info {
        padding: 15px;
    }

    .company-details {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .company-logo-img {
        width: 70px;
        height: 70px;
    }

    .company-name {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .company-address,
    .company-license {
        justify-content: center;
        font-size: 13px;
    }
}

/* 視頻區域樣式 */
.property-video {
    background: white;
    border-radius: 12px;
    padding: 15px 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.video-section {
    margin-top: 15px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.video-link {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.video-link a {
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
}

.video-link a:hover {
    text-decoration: underline;
}

.video-link small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

/* 圖片放大模態框樣式 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    width: 100vw;
    height: 100vh;
    padding: 24px;
    box-sizing: border-box;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: default;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 側邊欄佈局樣式 */
.main-content-sidebar {
    display: flex;
    gap: 30px;
    margin: 0 auto;
    align-items: flex-start;
}

.main-content-sidebar .property-detail-container {
    flex: 1;
    min-width: 0; /* 防止 flex 子項縮小過多 */
}

/* 側邊欄樣式 */
.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-top: 0px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    font-weight: bold;
}

.property-item-sidebar,
.sidebar .property-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
}

.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;
}

.sidebar .property-info {
    display: flex;
    flex-direction: column;
    min-height: 80px;
}

.property-title-sidebar,
.sidebar .property-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* max-width: 200px; */
}

.property-price-sidebar,
.sidebar .property-price-side {
    font-size: 16px;
    color: red;
    font-weight: 600;
    margin-bottom: 2px;
}

.property-location-sidebar,
.sidebar .property-location {
    font-size: 12px;
    color: #666;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0;
    margin-top: auto;
    box-shadow: none;
}

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

/* 經紀人卡片樣式 */
.agent-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.agent-avatar-sidebar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.agent-info-sidebar {
    flex: 1;
}

.agent-name-sidebar {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.agent-license {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.agent-contact {
    margin-top: 8px;
}

.contact-link {
    display: inline-block;
    padding: 6px 12px;
    background: #86ebff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.contact-link:hover {
    background: #7a1bd2;
    transform: translateY(-1px);
}

/* 公司卡片樣式 */
.company-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.company-logo-sidebar {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.company-info-sidebar {
    flex: 1;
}

.company-name-sidebar {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.company-license {
    font-size: 12px;
    color: #666;
}

/* 市場統計樣式 */
.market-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

/* 电脑端调整左右边距与首页一致 */
@media (min-width: 768px) {
    .main-container {
        display: flex;
        gap: 30px;
        margin: 20px 5%;
        padding: 0 50px;
    }

    .desktop-filter-section {
        grid-column: 1;
        grid-row: 1;
    }

    .main-content {
        flex: 1;
    }

    .sidebar {
        width: 365px;
        flex-shrink: 0;
    }
}

/* 手機端隱藏側邊欄 */
@media (max-width: 767px) {
    .main-content-sidebar {
        flex-direction: column;
    }

    .sidebar {
        display: none;
    }

    .main-content-sidebar .property-detail-container {
        max-width: 100%;
    }

    /* 確保在手機端不使用 Grid 佈局 */
    .main-container {
        display: block;
    }
}

/* 手機端優化 */
@media (max-width: 768px) {
    .image-modal {
        padding: 12px;
    }

    .image-modal-content {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 72px);
    }

    .image-modal-close {
        top: 10px;
        right: 16px;
        font-size: 30px;
    }
}
