/* room-detail.css - 房间详情页专用样式（已修复右侧溢出 + 移动端图片优化） */
.room-detail {
    width: 100%;
    max-width: 1160px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    margin: 20px auto;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* 仅重置直接子元素，避免穿透影响 */
.room-detail,
.room-detail > * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.room-name-wrapper {
    padding: 14px 20px 8px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.room-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
}
.main-content {
    display: flex;
    padding: 16px 20px 20px 20px;
    gap: 15px;
    flex: 1;
}
.left-col {
    width: 235px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.image-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.main-img {
    width: 200px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    cursor: pointer;
}
.main-img img, .small-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.main-img:hover img,
.small-img:hover img {
    transform: scale(1.08);
}
.small-imgs {
    display: flex;
    gap: 8px;
}
.small-img {
    width: 100px;
    height: 55px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    cursor: pointer;
}
.room-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.info-line {
    font-size: 14px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}
.right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
    min-width: 0; /* 防止flex子项溢出 */
}
.plan-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    display: flex;
    align-items: stretch;
    width: 100%;
    transition: box-shadow 0.2s;
    overflow: hidden; /* 防止内部溢出圆角 */
}
.plan-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* 三栏基础样式 */
.plan-part-1 {
    width: 320px;
    flex-shrink: 0;
    padding: 12px 0 12px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    border-right: 1px solid #e9ecef;
    box-sizing: border-box;
}
.plan-part-2 {
    width: 120px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e9ecef;
    box-sizing: border-box;
}
.plan-part-3 {
    /* 关键修复：改为弹性宽度，不再固定445px */
    flex: 1;
    min-width: 220px;
    padding: 12px 16px 12px 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
}

.plan-header {
    font-size: 15px;
    font-weight: 600;
    color: #e63946;
    background: #fff0f0;
    display: inline-block;
    padding: 2px 12px;
    border-radius: 30px;
    width: fit-content;
    margin-bottom: 4px;
}
.policy-text {
    font-size: 12px;
    color: #2c7a4d;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
}
.tagline {
    font-size: 12px;
    color: #e67e22;
    background: #fff7e5;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    width: fit-content;
}
.confirm-text, .online-pay {
    font-size: 12px;
    color: #4b5563;
    background: #f3f4f6;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
}
.occupancy {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    background: #f9fafb;
    padding: 6px 12px;
    border-radius: 40px;
}
.stock-info {
    font-size: 12px;
    font-weight: 600;
    color: #c7254e;
    background: #ffe9eb;
    padding: 4px 12px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}
.stock-info::before {
    content: "📦";
    font-size: 12px;
    font-weight: normal;
}
.price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.old-price {
    font-size: 15px;
    color: #9ca3af;
    text-decoration: line-through;
}
.new-price {
    font-size: 26px;
    font-weight: 800;
    color: #e63946;
    letter-spacing: -0.5px;
    white-space: nowrap; /* 防止价格换行 */
}
.book-btn, .room-book-btn {
    background-color: #e63946;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 5px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 8px;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}
.book-btn:hover, .room-book-btn:hover {
    background-color: #c62a36;
}

/* ========== 移动端适配（优化图片大小和右栏布局） ========== */
@media (max-width: 1000px) {
    .main-content {
        flex-wrap: wrap;
    }
    .left-col {
        width: 100%;
        flex-direction: column;
    }
    .image-area {
        width: 100%;
        flex-direction: row;
        gap: 10px;
        align-items: stretch;
    }
    .main-img {
        width: 65%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .small-imgs {
        flex: 1;
        flex-direction: column;
        gap: 8px;
    }
    .small-img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .plan-card {
        flex-wrap: wrap; /* 小屏幕允许换行 */
    }
    .plan-part-1, .plan-part-2, .plan-part-3 {
        width: auto;
        flex: 1 1 auto;
        border-right: none;
        padding: 10px 15px;
    }
    .plan-part-3 {
        align-items: flex-start;
    }
}

/* 更小屏幕（手机竖屏）进一步优化 */
@media (max-width: 600px) {
    .image-area {
        flex-direction: column;
    }
    .main-img {
        width: 100%;
        aspect-ratio: 16 / 9;
    }
    .small-imgs {
        flex-direction: row;
    }
    .small-img {
        flex: 1;
        aspect-ratio: 16 / 9;
    }
}