/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f0f9f0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* 顶部标题样式 */
.header-title {
    background: #fff;
    text-align: center;
    padding: 20px 0;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 0 0 16px 16px;
}

.header-title h1 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

/* 功能按钮区居中样式 */
.function-buttons.centered {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

/* 功能按钮样式 */
.function-btn {
    padding: 16px 32px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #81c784, #66bb6a);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(102, 187, 106, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: brightness(0) invert(1); /* 将图标颜色变为白色，与按钮文字颜色一致 */
}

.function-btn:active {
    background: linear-gradient(135deg, #66bb6a, #4caf50);
    transform: scale(0.96);
    box-shadow: 0 3px 8px rgba(102, 187, 106, 0.3);
}

.container {
    max-width: 640px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px;
}

/* 底部导航栏 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(102, 187, 106, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50%;
    height: 100%;
    color: #999;
}

.nav-item.active {
    color: #66bb6a;
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    transition: filter 0.3s ease;
    filter: brightness(0) saturate(100%) invert(60%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%); /* 默认灰色图标 */
}

.nav-item.active .nav-icon {
    filter: brightness(0) saturate(100%) invert(60%) sepia(12%) saturate(957%) hue-rotate(72deg) brightness(92%) contrast(92%); /* 激活状态下的绿色图标，与文字颜色一致 */
}

/* 线条图标样式 */
.line-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    transition: color 0.3s ease;
}

.line-icon.active {
    color: #66bb6a;
}

.nav-text {
    font-size: 12px;
}

/* 顶部轮播区域 */
.banner {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* 1:1 宽高比 */
    overflow: hidden;
    background-color: #f5f5f5;
}

.swiper-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.swiper-wrapper {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.swiper-pagination {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.swiper-pagination span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s;
}

.swiper-pagination span.active {
    width: 20px;
    border-radius: 4px;
    background-color: #fff;
}

/* 功能按钮区 */
.features {
    display: flex;
    padding: 20px;
    gap: 12px;
}

.feature-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #66bb6a, #4caf50);
    color: #fff;
    text-align: center;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.3);
    position: relative;
    overflow: hidden;
}

.feature-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1890ff, #36cfc9);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.feature-btn:active {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(102, 187, 106, 0.3);
}

/* 静音舱列表 */
.cabin-list h2 {
    font-size: 20px;
    font-weight: 600;
    padding: 0 20px 10px;
    margin-bottom: 10px;
    color: #333;
}

.cabin-list {
    padding: 20px 15px;
    background-color: #f0f9f0;
    margin: 15px 0;
    border-radius: 16px;
}

.cabin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.cabin-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(5px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.cabin-card:active {
    transform: scale(0.96);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.cabin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.cabin-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.cabin-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cabin-card:active .cabin-image img {
    transform: scale(1.1);
}

.cabin-info {
    padding: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
}

.cabin-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cabin-info p {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.cabin-info .price {
    font-size: 16px;
    color: #4caf50;
    font-weight: 600;
    margin-bottom: 0;
}

/* 响应式优化 */
@media screen and (max-width: 375px) {
    .carousel {
        height: 160px;
    }
    
    .cabin-image {
        height: 140px;
    }
    
    .features {
        padding: 15px;
        gap: 10px;
    }
}

@media screen and (max-width: 320px) {
    .carousel {
        height: 140px;
    }
    
    .cabin-image {
        height: 120px;
    }
    
    .feature-btn {
        padding: 12px;
        font-size: 15px;
    }
}

/* 通用按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background-color: #66bb6a;
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background-color: #66bb6a;
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 187, 106, 0.3);
}

.btn-primary:active {
    background-color: #4caf50;
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(102, 187, 106, 0.3);
}

.btn-danger {
    background-color: #ff4d4f;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
}

.btn-danger:active {
    background-color: #ff7875;
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(255, 77, 79, 0.3);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:active {
    background-color: #e0e0e0;
    transform: scale(0.98);
}

.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-disabled:active {
    transform: none !important;
}

/* 底部导航栏交互优化 */
.nav-item {
    transition: transform 0.2s;
}

.nav-item:active {
    transform: scale(0.9);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* 页面标题栏 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 15px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.header-back {
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.header-back:active {
    transform: scale(0.9);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    text-align: center;
}

.header-placeholder {
    width: 34px;
}

/* 响应式调整 */
@media screen and (max-width: 375px) {
    body {
        font-size: 15px;
    }
    
    .header {
        height: 46px;
    }
    
    .header-title {
        font-size: 17px;
    }
    
    .container {
        padding-bottom: 55px;
    }
}

@media screen and (max-width: 320px) {
    body {
        font-size: 14px;
    }
    
    .header {
        height: 44px;
        padding: 0 12px;
    }
    
    .header-title {
        font-size: 16px;
    }
}

/* 响应式设计 */
@media (min-width: 641px) {
    .container {
        border-left: 1px solid #eee;
        border-right: 1px solid #eee;
    }
}

/* 提示弹窗 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

/* 确认弹窗 */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.confirm-modal.show {
    opacity: 1;
    visibility: visible;
}

.confirm-content {
    background-color: #fff;
    border-radius: 8px;
    width: 80%;
    max-width: 300px;
    padding: 20px;
}

.confirm-title {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.confirm-message {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
}

.confirm-buttons .btn {
    flex: 1;
}

.confirm-buttons .btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.confirm-buttons .btn-secondary:active {
    background-color: #e0e0e0;
}