/* css/detail.css */

* { box-sizing: border-box; margin: 0; padding: 0; }
/* ============ 通用容器与基础样式 ============ */
body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: #fff;
    color: #333;
    padding: 20px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
  list-style: none; /* 清除项目符号/数字序号 */
  padding: 0;       /* 清除默认内边距 */
  margin: 0;        /* 清除默认外边距 */
}

/* ============ 头部 Logo ============ */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}
.logo img {
    width:70px;
    margin-right: 12px;
}
.site-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

/* ============ 主内容区（PC 两栏） ============ */
.main-content {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    align-items: flex-start; 
    
}

/* 左侧列：图片 + Tab */
.left-column {
    width: 500px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* 图片容器 */
.left-img {
    width: 100%;
    height: 340px;
    background: #f9f9f9;
    border: 1px solid #eee;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.left-img img#bigImg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.left-img img#bigImg.fading { opacity: 0; }

.left-img .placeholder { color: #ccc; font-size: 30px; }

/* 左右箭头：默认半透明白，悬停在图上变纯白并放大 */
.left-img .arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 34px;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    padding: 8px 14px;
    user-select: none;
    transition: color 0.25s, transform 0.25s, text-shadow 0.25s;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    z-index: 2;
}
.left-img .arrow.left  { left: 5px; }
.left-img .arrow.right { right: 5px; }

.left-img:hover .arrow {
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}
.left-img .arrow:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
}

/* ============ Tab 标签（紧贴图片下方） ============ */
.tabs {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid #eee;
    margin-top: 15px;
    padding-bottom: 12px;
}
.tabs span {
    font-size: 16px;
    color: #666;
    cursor: pointer;
    position: relative;
    padding-bottom: 5px;
    white-space: nowrap;
}
.tabs span.active { color: #333; font-weight: bold; }
.tabs span.active::after {
    content: "";
    position: absolute;
    bottom: -13px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #e60012;
    border-radius: 2px;
}

/* ============ 右侧信息 ============ */
.right-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.right-info h1 { font-size: 28px; font-weight: bold; margin-bottom: 15px; }
.tags { display: flex; gap: 10px; margin-bottom: 18px; }
.tag { display: inline-block; padding: 4px 12px; font-size: 13px; border-radius: 3px; color: #fff; }

/* 标签通用样式 */
.tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 3px;
    color: #fff;
}

/* 状态标签 */
.tag.status-onsale  { background: #00b36b; }   /* 在售：绿 */
.tag.status-unsold  { background: #ff8c00; }   /* 未售：橙 */
.tag.status-soldout { background: #999;    }   /* 售罄：灰 */
.tag.status-pending { background: #409eff; }   /* 待售：蓝 */
.tag.status-default { background: #888;    }   /* 其他：灰 */

/* 物业类型标签 */
.tag.type-residential { background: #f5970b; }  /* 住宅：红 */
.tag.type-apartment   { background: #409eff; }  /* 公寓：蓝 */
.tag.type-office      { background: #9c27b0; }  /* 写字楼：紫 */
.tag.type-villa       { background: #00bcd4; }  /* 别墅：青 */
.tag.type-shop        { background: #ff8c00; }  /* 商铺：橙 */
.tag.type-default     { background: #888;    }  /* 其他：灰 */

.price-row { display: flex; align-items: baseline; margin-bottom: 18px; }
.price-row .label { font-size: 14px; color: #666; margin-right: 8px; }
.price-row .price { color: #e60012; font-size: 26px; font-weight: bold; }
.price-row .unit { color: #e60012; font-size: 14px; margin-left: 3px; }

.info-list { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: #666; margin-bottom: 20px; }
.info-list .item { display: flex; }
.info-list .label { width: 50px; color: #999; flex-shrink: 0; }
.info-list .value { color: #333; }
.gap-18 { display: inline-block; width: 18px; }

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;   /* 改为固定 20px 间距，按钮紧跟在信息下面 */
}
.btn-group button { border: none; padding: 10px 28px; font-size: 15px; color: #fff; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn-discount { background: #00b36b; }
.btn-commission { background: #ff8c00; }

/* ============ 楼盘详情段落 ============ */
.section-title { font-size: 20px; font-weight: bold; margin: 25px 0 15px 0; color: #333; }

.section-box p { font-size: 16px; color: #555; line-height: 1.9; margin-bottom: 8px; }
.section-box p:last-child { margin-bottom: 0; }

/* 列表样式（交通/教育/生态等） */
.custom-list { padding-left: 22px; margin: 0; line-height: 1.9; color: #555; font-size: 16px; }

/* ============ 区块标题与内容美化 ============ */
.section-title-wrap {
    margin: 35px 0 15px 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}



.section-box {
    line-height: 1.9;
}


/* 适配原本的 ul 列表 */
.section-box .custom-list {
    padding-left: 20px;
    margin: 0;
    color: #555;
}
.section-box .custom-list li {
    margin-bottom: 8px;
}
.section-box .custom-list li:last-child {
    margin-bottom: 0;
}

/* 户型图网格 */
.floorplan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.floorplan-item {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    cursor: zoom-in;
    transition: all 0.3s;
    text-align: center;
}
.floorplan-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: #00b36b; /* 悬停边框变绿 */
    transform: translateY(-2px);
}
.floorplan-item img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    margin-bottom: 10px;
}
.floorplan-desc {
    font-size: 15px;
    font-weight: bold;
    color: #333;
}

/* 移动端响应式 */
@media screen and (max-width: 768px) {
    .section-box { padding: 15px; font-size: 14px; }
    .section-title { font-size: 17px; padding: 4px 10px; }
    
    .floorplan-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .floorplan-item img { height: 150px; }
    .floorplan-desc { font-size: 13px; }
}

/* ============ 推荐楼盘 ============ */
.recommend-list { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.rec-link { text-decoration: none; color: inherit; display: block; }
.rec-item { display: flex; border: 1px solid #eee; border-radius: 6px; padding: 15px; gap: 15px; align-items: center; transition: box-shadow 0.2s; }
.rec-item:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.rec-img { width: 120px; height: 80px; background: #f0f0f0; border-radius: 4px; overflow: hidden; display: flex; justify-content: center; align-items: center; color: #ccc; font-size: 12px; flex-shrink: 0; }
.rec-img img { width: 100%; height: 100%; object-fit: cover; }
.rec-info { flex: 1; }
.rec-title { font-size: 16px; font-weight: bold; margin-bottom: 5px; }
.rec-address { font-size: 12px; color: #999; margin-bottom: 5px; }
.rec-room { font-size: 12px; color: #666; }
.rec-tags { margin-top: 5px; display: flex; gap: 5px; }
.rec-tags span { font-size: 11px; padding: 1px 6px; border-radius: 2px; color: #fff; }
.rec-tags .tag-status { background: #409eff; }
.rec-tags .tag-type { background: #00b36b; }
.rec-price { text-align: right; min-width: 120px; }
.rec-price .num { color: #e60012; font-size: 18px; font-weight: bold; }
.rec-price .unit { color: #e60012; font-size: 12px; }

/* ============ 页脚 ============ */
.footer { margin-top: 50px; text-align: center; color: #999; font-size: 13px; line-height: 2; border-top: 1px solid #eee; padding-top: 20px; }

/* ============ 图片放大预览层 ============ */
.img-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
.img-modal.show { display: flex; }

.img-modal .modal-img-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.img-modal img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.img-modal .modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 44px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 10px 20px;
    user-select: none;
    transition: color 0.2s, background 0.2s;
    z-index: 2;
}
.img-modal .modal-arrow:hover { color: #fff; background: rgba(255, 255, 255, 0.08); border-radius: 6px; }
.img-modal .modal-arrow.left  { left: 10px; }
.img-modal .modal-arrow.right { right: 10px; }

.img-modal .modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    line-height: 1;
    z-index: 3;
    transition: color 0.2s;
}
.img-modal .modal-close:hover { color: #fff; }

.img-modal .modal-counter {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 14px;
    border-radius: 20px;
    z-index: 2;
}

/* ============ 户型图鉴赏 ============ */
.floorplan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 一排3张 */
    gap: 20px;
    margin-bottom: 30px;
}

.floorplan-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
    cursor: zoom-in; /* 鼠标变放大镜 */
    transition: all 0.3s;
    text-align: center;
}

.floorplan-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: #e60012;
}

.floorplan-item img {
    width: 100%;
    height: 220px;      /* 固定高度，防止图片大小不一导致排版乱 */
    object-fit: contain; /* 保证户型图完整显示，不裁剪 */
    border-radius: 4px;
    margin-bottom: 8px;
}

.floorplan-desc {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
}

/* 移动端适配：手机上一排显示2张 */
@media screen and (max-width: 768px) {
    .floorplan-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .floorplan-item img {
        height: 150px;
    }
    .floorplan-desc {
        font-size: 12px;
    }
}

/* ============ 移动端响应式 ============ */
@media screen and (max-width: 768px) {

    /* 主内容区：改为纵向堆叠 */
    .main-content {
        flex-direction: column;
        gap: 15px;
    }

    .left-column { width: 100%; }
    .left-img { height: 240px; }

    /* Tab 横向可滑动 */
    .tabs {
        gap: 20px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }
    .tabs span { font-size: 14px; }

    /* 右侧信息 */
    .right-info h1 { font-size: 22px; margin-bottom: 10px; }
    .price-row .price { font-size: 22px; }
    .info-list { font-size: 13px; gap: 8px; }
    .btn-group { margin-top: 15px; }
    .btn-group button { padding: 10px 22px; font-size: 14px; }

    /* 推荐楼盘 */
    .rec-item { flex-direction: column; align-items: flex-start; }
    .rec-img { width: 100%; height: 150px; }
    .rec-price { width: 100%; text-align: left; margin-top: 10px; }

    /* 放大预览 */
    .img-modal .modal-arrow { font-size: 32px; padding: 8px 12px; }
    .img-modal .modal-close { font-size: 28px; top: 12px; right: 15px; }
    .img-modal img { max-width: 96vw; max-height: 80vh; }
}

/* ============================================================
   底部操作栏（折扣价、赚佣金）
   ============================================================ */
.action-bar {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-group button {
    flex: 1; /* 让按钮平分宽度 */
    border: none;
    padding: 12px 0;
    font-size: 16px;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-discount { background: #00b36b; }
.btn-commission { background: #ff8c00; }

/* ============================================================
   移动端吸底特效 (宽度 <= 768px 时生效)
   ============================================================ */
@media screen and (max-width: 768px) {
    /* 给页面底部留出空间，防止内容被吸底栏挡住 */
    body {
        padding-bottom: 80px; 
    }

    .action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 10px 15px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        z-index: 999;
        /* 适配 iPhone 底部小黑条 */
        padding-bottom: calc(10px + env(safe-area-inset-bottom)); 
    }

    .action-bar .btn-group {
        margin-top: 0;
        gap: 10px;
    }

    .action-bar button {
        padding: 12px 0;
        font-size: 16px;
        border-radius: 6px;
    }
}