/* 天气和温馨提示相关样式 */

/* 百度样式的天气预报区域 */
.weather-container {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.weather-info:hover {
    background-color: #f5f5f5;
}

.weather-icon {
    font-size: 18px;
}

.weather-icon.hidden {
    display: none;
}

.weather-temp.hidden {
    display: none;
}

.weather-details {
    display: flex;
    flex-direction: column;
}

.weather-city {
    font-weight: bold;
    color: #333;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 200px;
}

.weather-temp {
    color: #ff6600;
}

/* 天气预报弹窗 */
.weather-popup {
    position: absolute;
    top: 100%;
    right: 2%;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px;
    width: 500px;
    z-index: 200;
    display: none; /* 默认隐藏 */
}

.weather-popup.show {
    display: block; /* 显示弹窗 */
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.popup-title {
    font-weight: bold;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
    background-color: #f5f5f5;
    border-radius: 50%;
}

/* 天气图标横排显示区域 */
.weather-forecast {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;  /* 从左到右依次排列 */
    align-items: center;
    text-align: center;
    width: 100%;
    overflow-x: auto;  /* 启用横向滚动 */
    gap: 10px;  /* 项目间距 */
    padding-bottom: 10px;  /* 为滚动条留空间 */
}

.forecast-item {
    flex: none;  /* 不自动填充 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    min-width: 80px;  /* 最小宽度 */
}

.forecast-date {
    font-size: 12px;
    color: #999;
}

.forecast-icon {
    font-size: 24px;
}

.forecast-temp {
    font-size: 12px;
    color: #333;
}

/* 位置选择器 */
.location-selector {
    margin-bottom: 15px;
}

.location-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.location-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.location-btn:hover {
    background: #0056b3;
}

.location-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

/* 温馨提示滚动区域 */
.greeting-container {
    position: absolute;
    right: 2%;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 30px;
    overflow: hidden;
    font-size: 14px;
    color: #333;
    display: none;
}

.greeting-text {
    white-space: nowrap;
    font-weight: bold;
}

/* 天气相关响应式调整 */
@media (max-width: 768px) {
    .weather-popup {
        right: 5%;
        left: 5%;
        width: auto;
    }

    .weather-forecast {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .forecast-item {
        min-width: 80px;
    }

    .weather-city {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .weather-container {
        font-size: 12px;
    }
}
