/* styles.css?v=2025101802 */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #2d3748;
}

/* 容器样式 */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f7fafc;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page-loader p {
    margin-top: 16px;
    color: #4a5568;
    font-size: 14px;
    text-align: center;
}

/* 头部导航 */
.header {
    background: linear-gradient(180deg, #ffffff, #f7fafc);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.header.scrolled {
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    width: 120px;
    height: auto; /* 保持原始 60x40px 的比例 (3:2) */
    margin-right: 12px;
    object-fit: contain; /* 确保比例不变 */
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1a202c;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center; /* 确保文字垂直居中 */
    transition: all 0.3s ease;
    text-align: center; /* 确保文字水平居中 */
    gap: 8px; /* 图标和文字间距 */
}

.btn-primary {
    background: linear-gradient(45deg, #3b82f6, #60a5fa);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #2563eb, #4b8df8);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(45deg, #4b5563, #6b7280);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #374151, #5a687d);
    transform: translateY(-1px);
}

.btn-goofish {
    background: #ff6200;
    color: white;
}

.btn-goofish:hover {
    background: #e55b00;
}

.btn-tiktok {
    background: #000;
    color: white;
}

.btn-tiktok:hover {
    background: #333;
}

.btn-redbook {
    background: #ff2d55;
    color: white;
}

.btn-redbook:hover {
    background: #e0284d;
}

.btn-pdd {
    background: #e0212a;
    color: white;
}

.btn-pdd:hover {
    background: #c71c24;
}

/* 搜索框样式 */
.search-bar {
    max-width: 1440px;
    margin: 16px auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 60%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #6b7280;
    font-size: 16px;
}

#addressInput {
    flex: 1;
    padding: 10px 40px 10px 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#addressInput:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.clear-btn:hover {
    color: #3b82f6;
}

.error-message {
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 60px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
}

.suggestion-item {
    padding: 10px 12px;
    font-size: 14px;
    color: #2d3748;
    cursor: pointer;
}

.suggestion-item:hover {
    background: #f3f4f6;
}

.suggestion-address {
    color: #6b7280;
    font-size: 12px;
}

.hidden {
    display: none;
}

/* 主要内容区 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
}

@media (min-width: 1024px) {
    .main-content {
        flex-direction: row;
        height: calc(100vh - 180px);
        gap: 24px;
    }

    .map-section {
        flex: 3;
        position: relative;
        min-height: 400px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        padding-left: 16px;
    }

    .search-bar {
        max-width: 100%;
        padding: 0;
    }

    .search-input-wrapper {
        max-width: 500px;
    }

    #searchAddressBtn, #locateBtn {
        min-width: 120px;
    }
}

.map-section {
    flex: 3;
    position: relative;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* styles.css */

@media (max-width: 768px) {
    .map-section {
        width: 100%; /* 确保占满容器 */
        max-width: 100vw; /* 自适应视口 */
        margin: 0 auto; /* 居中，保持原样式 */
        padding: 0; /* 移除 padding，避免挤压 */
        min-height: 400px; /* 确保最小高度，防止塌陷 */
    }

    #mapContainer {
        width: 100%; /* 自适应父容器宽度 */
        height: 400px; /* 固定高度 */
        min-height: 400px; /* 防止塌陷 */
        max-width: 100vw; /* 防止溢出 */
        position: relative; /* 确保定位上下文，用于加载遮罩 */
    }

    .map-loader {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
        transition: opacity 0.3s ease;
    }

    .map-loader.hidden {
        display: none; /* 明确隐藏，防止覆盖地图 */
        opacity: 0;
        pointer-events: none;
    }

    .header h1 {
        font-size: 20px; /* 保留原样式 */
    }

    .logo-img {
        width: 40px;
        height: 27px;
        object-fit: contain; /* 保留原样式 */
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px; /* 保留原样式 */
    }

    .search-input-wrapper {
        width: 100%;
        max-width: none; /* 保留原样式 */
    }

    #searchAddressBtn, #locateBtn {
        width: 100%;
        margin-top: 8px; /* 保留原样式 */
    }

    .main-content {
        height: auto; /* 保留原样式 */
    }

    .station-list-section {
        max-height: none;
        padding: 12px; /* 保留原样式 */
    }

    .section-header h2 {
        font-size: 18px; /* 保留原样式 */
    }
}

/* 地图容器全局保障 */
#mapContainer {
    width: 100%; /* 自适应父容器 */
    max-width: 100vw; /* 防止溢出 */
    height: 100%; /* 继承父容器高度 */
    min-height: 400px; /* 全局最小高度 */
    position: relative;
}

.map-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease; /* 过渡效果 */
}

.map-loader.hidden {
    opacity: 0;
    pointer-events: none; /* 防止点击穿透 */
}

/* 检测站列表 */
.station-list-section {
    flex: 2;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 16px;
    overflow-y: auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
}

.station-count {
    font-size: 14px;
    color: #6b7280;
}

.station-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.station-list-item {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.station-list-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.station-list-item h4 {
    color: #1a73e8;
    margin: 0 0 8px 0;
    font-weight: 600;
    font-size: 16px;
}

.station-list-item p {
    font-size: 14px;
    color: #4b5563;
    margin: 4px 0;
}

.original-price {
    text-decoration: line-through;
    color: #9ca3af;
}

.discount-price {
    color: #e53e3e;
    font-weight: 600;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    padding: 24px;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #3b82f6;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #4b5563;
}

.info-item i {
    margin-right: 10px;
    font-size: 18px;
}

.text-primary {
    color: #3b82f6;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

@media (min-width: 1024px) {
    .modal-footer {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .modal-footer .appointment-buttons {
        display: flex;
        gap: 12px;
        width: 100%;
    }

    .btn-goofish, .btn-tiktok, .btn-redbook, .btn-pdd {
        width: 120px;
        padding: 10px 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #navigateBtn {
        width: 550px; /* 四个按钮总宽度 */
        padding: 10px 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 所有设备按钮样式 */
.modal-footer .btn {
    flex: 0 0 auto;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 12px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-footer .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }
}

/* 权限引导弹窗 */
.platform-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.platform-tab {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f3f4f6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.platform-tab.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.platform-content {
    display: none;
}

.platform-content.active {
    display: block;
}

.platform-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.platform-content ol {
    font-size: 14px;
    color: #4b5563;
}

/* 页脚 */
.footer {
    background: #f7fafc;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footer-copyright p {
    font-size: 13px;
    color: #6b7280;
}

.footer-tips p {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-tips i {
    margin-right: 8px;
}

/* Font Awesome 图标调整 */
.fa {
    font-size: 16px;
}

.fa-spin {
    animation: fa-spin 2s infinite linear;
}

.text-3xl {
    font-size: 1.875rem;
}

.text-primary {
    color: #3b82f6;
}

/* 地址复制功能样式 */
.info-item .copyable-address {
    cursor: pointer;
    text-decoration: underline;
    color: #1890ff;
    transition: all 0.3s ease;
}

.info-item .copyable-address:hover {
    color: #40a9ff;
    background-color: #f0f8ff;
    border-radius: 4px;
    padding: 2px 4px;
}

.info-item .copyable-address:active {
    color: #096dd9;
}

/* 复制成功动画 */
.copy-success {
    animation: copyPulse 1.5s ease;
}

@keyframes copyPulse {
    0% {
        background-color: #f6ffed;
        color: #52c41a;
    }
    50% {
        background-color: #f6ffed;
        color: #52c41a;
    }
    100% {
        background-color: transparent;
        color: #1890ff;
    }
}